Sell a curated set of products for one fixed total price using your own storefront UI. Read the rule, render a selector, add to cart with Appstle’s bundle attributes, and let the automatic discount price the set.
A fixed pricing bundle sells a defined set of products for one fixed total price, regardless of the sum of the individual item prices. For example, “Any 3 candles for $40” — if the candles total $54, the customer saves $14 automatically.This guide shows how to run a fixed pricing bundle entirely from your own storefront UI. You use the same metafield, cart-line attributes, and Shopify Function that Appstle’s built-in widget uses — only the UI is yours. If you have not yet read the headless overview, start there — it explains the automatic-discount model these steps rely on.
The merchant sets a single price on the rule — the total the customer pays for the bundle. Appstle’s discount Function reduces the bundled lines so their combined total equals price:
customer pays = pricecustomer saves = (sum of selected line prices) − price
The discount is applied automatically at checkout once the lines carry the bundle attributes. You do not compute or submit the discount.
Read the active rules from the appstle_bundles.bundle_rules shop metafield — the Shopify-native source, with no call to Appstle’s servers (see Reading bundle configuration). Filter to fixed pricing bundles by bundleType + bundleSubType.
Take the eligible product and variant IDs from the rule’s products / variants fields and hydrate titles, images, and prices with Shopify’s own Storefront API or Liquid product objects. If you would rather receive a pre-parsed product list from Appstle, the App Proxy endpoint GET /bundles/bb/api/build-a-box/get-bundle/{handle} returns one — use it as a last resort and cache the response.
When the selection is valid, add the chosen variants to the cart with the required attributes. For a fixed pricing bundle, each component line carries _appstle-bb-id, _appstle_bundles_type, and __appstle-bb-name.
Every line that belongs to the bundle must carry the same_appstle-bb-id. A line without the attributes is treated as a normal product and is not priced into the fixed total.
Once the lines are in the cart, Appstle’s automatic discount reduces the bundled lines so the set totals price. It shows in the cart, persists through checkout, and is reflected on the order. There is nothing else to call.
To show the customer what they save before checkout, compute it from the rule (remember cart prices are in cents):
// linePrices: array of unit prices (in cents) × quantities for the selected itemsconst subtotal = linePrices.reduce((sum, cents) => sum + cents, 0);const fixedTotalCents = Math.round(bundle.price * 100);const savingsCents = Math.max(0, subtotal - fixedTotalCents);// e.g. "You save $14.00"const savingsLabel = `You save ${(savingsCents / 100).toFixed(2)}`;
This is a display-only preview. The Shopify Function applies the authoritative discount at checkout from the same price, so the two always agree.