Skip to content

fix(price): fix locale-based price selection and VAT note ordering#172

Open
stacelKonrad wants to merge 2 commits into
mainfrom
45-feat-price-box-component
Open

fix(price): fix locale-based price selection and VAT note ordering#172
stacelKonrad wants to merge 2 commits into
mainfrom
45-feat-price-box-component

Conversation

@stacelKonrad

Copy link
Copy Markdown
Collaborator
  • Add price field to ProductVariantApiResponseSchema so CT's pre-selected embedded price survives Zod parsing instead of being silently stripped
  • Update price mapper to prefer variant.price over manual prices array filtering, ensuring CT's currency-matched price is used correctly per locale
  • Append _locale param to BFF fetch URLs so Next.js data cache varies per locale (cache keys are URL-based, not header-based)
  • Move VAT tax note before the main price in DecoratedPrice and remove CSS order overrides in favour of natural DOM order

- Add price field to ProductVariantApiResponseSchema so CT's pre-selected
  embedded price survives Zod parsing instead of being silently stripped
- Update price mapper to prefer variant.price over manual prices array filtering,
  ensuring CT's currency-matched price is used correctly per locale
- Append _locale param to BFF fetch URLs so Next.js data cache varies per locale
  (cache keys are URL-based, not header-based)
- Move VAT tax note before the main price in DecoratedPrice and remove CSS order
  overrides in favour of natural DOM order
@stacelKonrad stacelKonrad requested a review from a team May 28, 2026 13:15
@stacelKonrad stacelKonrad linked an issue May 28, 2026 that may be closed by this pull request
9 tasks
export const ProductVariantApiResponseSchema = z.object({
id: z.number(),
sku: z.string().optional(),
price: PriceApiResponseSchema.optional(),

@Arnimag Arnimag May 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see connection of this new "price" here? and still there are prices. Or we take both? Maybe prices should not be there at all

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are taking both. First pick is "price" if it is absent we are falling back to prices and old way of finding price(price.ts line 18).

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.

FEAT: Price box component

2 participants