Skip to content

fix(paywalls): use displayed price currency token for product.offer_price#7270

Draft
vegaro wants to merge 2 commits into
mainfrom
cesar/currency-symbol-paywall-logic
Draft

fix(paywalls): use displayed price currency token for product.offer_price#7270
vegaro wants to merge 2 commits into
mainfrom
cesar/currency-symbol-paywall-logic

Conversation

@vegaro

@vegaro vegaro commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

{{ product.offer_price }} in Paywalls V2 reformatted the discount's decimal price through the product's NumberFormatter. When the formatter's locale metadata doesn't match the product currency, that formatter emits a different currency token than the product's displayed price — e.g. rendering 6,99 USD where the rest of the paywall shows $6.99. This is the same divergence that #6209 and #6572 fixed for product.currency_symbol, which now derives its token from the displayed price string.

The offer price now formats the discount's localizedPriceString instead, mirroring the base product.price path, so the currency token stays consistent across the paywall.

Known limitation: the per-period offer variables (offer_price_per_day/week/month/year) still format via NumberFormatter because the discount exposes no pre-formatted per-period display string to reuse. Left out of scope here.

Testing

Added a regression test with a product whose displayed price uses $ but whose formatter locale (ro_RO) renders the currency differently; the offer price now matches the displayed token. Verified via the existing pay-up-front and zero-decimal offer-price tests that whole-number stripping and $1.99/$2/$2.00 cases are unaffected.

…rice

`product.offer_price` reformatted the discount's decimal price through
`NumberFormatter`, which can emit a different currency token than the
product's displayed price (e.g. "6,99 USD" instead of "$6.99") when the
formatter locale metadata doesn't match the product currency. This made
the offer price inconsistent with `product.price` and
`product.currency_symbol`, both of which derive from the displayed price
string.

Format the discount's `localizedPriceString` instead, mirroring the base
price path, so the currency token stays consistent across the paywall.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant