Cart Subtotal
Displays the cart total cost, re-fetching variant prices per active market to show a localised total.
What it does
AP_CartSubtotal displays the cart's total cost. When a market is active, it re-fetches each variant's price in context to show the localised total rather than the stored base price. Currency symbol and code are automatically populated from the active market.
How to set it up
Place AP_CartSubtotal anywhere in your cart drawer. No configuration is needed for currency handling, as the symbol and code are drawn from the active market. For design work in the canvas, set a preview total value so you can style the component without needing live cart data.
Key behaviours
- Calculates the total by fetching each variant's market-context price via the Shopify Storefront API
- Falls back to stored prices when no market is set
- Fades to 50% opacity during re-fetching and restores automatically when complete
- Canvas shows a static preview price for design work