Skip to content

fix(seo): BUY-59851 harden landing-page product rendering against empty cards - #190

Open
BuyWhere wants to merge 3 commits into
mainfrom
fix/BUY-59851-seo-empty-cards
Open

fix(seo): BUY-59851 harden landing-page product rendering against empty cards#190
BuyWhere wants to merge 3 commits into
mainfrom
fix/BUY-59851-seo-empty-cards

Conversation

@BuyWhere

@BuyWhere BuyWhere commented Jul 3, 2026

Copy link
Copy Markdown
Owner

BUY-59851 — SEO landing pages render empty skeleton cards

Root cause: SEO landing pages rendered visually styled but empty product cards when /v1/products/search returned malformed items (missing names/prices, dead # hrefs). Old normalizeProduct emitted Untitled product names, null prices, and # links.

Fix (src/lib/seo-landing-pages.ts):

  • Add isValidLandingProduct guard (valid id, non-empty name, non-null price).
  • Filter both API-mapped and fallback products through the guard.
  • Throw to fallback when API yields zero valid products.
  • Replace # href fallback with deterministic /search?q=&country= links.

Verification: All four affected pages on production already render valid fallback cards (live HTML confirms Current price + View offer, no Price unavailable/Untitled product). This hardens the path so the empty-card regression cannot recur if a server-side key is configured.

Oracle (CDO) added 3 commits July 3, 2026 10:52
…ty cards

SEO landing pages (/best-gaming-laptops-us, /laptop-singapore,
/air-purifier-singapore, /best-robot-vacuums-2026) could render visually
styled but empty product cards when the /v1/products/search response
returned malformed items (missing names/prices, '#' hrefs). The old
normalizeProduct emitted 'Untitled product' names, null prices, and '#'
links that rendered as bare gradient containers.

- Add isValidLandingProduct guard (requires id, non-empty name, non-null price)
- Filter both API-mapped and fallback products through the guard
- Throw to fallback when API yields zero valid products
- Replace '#' href fallback with deterministic /search?q=&country= links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant