From 59e3ca338bd7dc6627cbb758acc660c9b8fd0746 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Tue, 28 Apr 2026 22:28:01 +0800 Subject: [PATCH] fix(search): correct PriceTag logic for free pricing - Return null when price is missing instead of showing 'Free' - Show green 'Free' badge only when initial === 0 && final === 0 - Show emerald 'Free*' badge with tooltip for promotional free (final === 0, initial > 0) - Fixes incorrect 'Free' label for games like Days Gone during free weekends --- app/search/page.tsx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/app/search/page.tsx b/app/search/page.tsx index 60d773e..e899191 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -535,17 +535,32 @@ function PriceTag({ }: { price?: { currency: string; initial: number; final: number } | null }) { - if (!price || price.final === 0) { + if (!price) { + return null + } + + // Price is 0 and initial is 0 → legitimately free-to-play + if (price.initial === 0 && price.final === 0) { return ( - + Free ) } + // Price is 0 but initial > 0 → promotional free (free weekend etc.) + if (price.final === 0 && price.initial > 0) { + return ( + + Free* + + ) + } + + // Normal paid game const isDiscounted = price.final < price.initial const fmt = new Intl.NumberFormat("en-US", { style: "currency",