Hi,
I’m working on custom bundles functionality, where the bundle discount should be based on the product’s full price. To achieve this, I’m storing the full price in a metafield and calculating the discount correctly in my Shopify Function. The issue I’m encountering is that while the discount is applied based on the full price, the checkout calculations are still using the product’s price (not the compare-at price or metafield) to display the “before discount” value.
For example (see the screenshots below)
- Compare-at price: £800
- Price: £749.95
- Bundle discount: 10% off the full price (800 * 2 * 0.1 = £160)
While the discount amount is correct, the “before discount” price in the checkout shows £1499.90 (based on the product price) instead of £1600 (based on the compare-at price). What I need is for the before discount price in checkout to show £1600 and the order total to show £1440.
Is it possible to use the compare-at price (or product metafield) for checkout calculations to ensure the “before discount” price is correct? If so, could you please provide guidance on how to achieve this?
Thank you!

