You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sales): show original price and correct discount % for active sales
Tebex's Headless /packages API reports an active (user-specific) sale only with an authenticated basket ident, and in a counter-intuitive shape: base_price is the post-discount price, discount is the amount removed, total_price is the payable price. The original price is base_price + discount.
The previous code treated base_price as the original and dropped discount, so the strikethrough equaled the sale price and the badge rendered 'SALE -0%'.
Add a shared resolveDisplayPrice helper (lib/price.ts): original = base_price + discount, price = total_price, with a float guard against rounding-induced -0%. Thread discount through the sale-prices store and SalePriceFetcher, and use the helper in both PackagePrice and PackageCard.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments