bundleType | VOLUME_DISCOUNT |
discountType | TIERED_DISCOUNT |
| Read from | appstle_bundles.bundle_rules shop metafield |
| Discount applied by | Appstle automatic discount (Shopify Function) |
How pricing works
The tiers live in the rule’stieredDiscount field as a JSON-encoded string. Parse it into an array of tier objects:
| Tier field | Type | Meaning |
|---|---|---|
discountBasedOn | string | QUANTITY (threshold on item count) or AMOUNT (threshold on spend, in the store currency’s major unit). |
value | integer | The threshold to reach this tier (e.g. 3 items, or 50 for $50 spend). |
discount | number | The discount magnitude. |
discountType | string | PERCENTAGE or FIXED_AMOUNT. |
titleLabel / subtitleLabel / badgeLabel | string | Optional display labels you can reuse in your UI. |
- Among
QUANTITYtiers, keep those wherecartQuantity ≥ value. - Among
AMOUNTtiers, keep those wheresubtotal ≥ value. - From all qualifying tiers, apply the one with the largest
discount.
Step 1 — Read the rule and parse the tiers
Read the active rules from theappstle_bundles.bundle_rules shop metafield — the Shopify-native source, with no call to Appstle’s servers (see Reading bundle configuration). Filter to volume discount bundles by bundleType, then parse the tieredDiscount JSON string.
| Field | Use |
|---|---|
uniqueRef | Attach to every cart line as _appstle-bb-id. |
name | Display label; attach as __appstle-bb-name. |
tieredDiscount | JSON string of tier objects (parse it). |
products / variants | Eligible products and variants (JSON). |
Step 2 — Render the tier ladder
Build your own UI from the parsed tiers:- Show the ladder (e.g. “Buy 3 → 10% off · Buy 6 → 20% off”) using
value,discount, and the optional labels. - Track the running quantity and subtotal, highlight the tier the customer currently qualifies for, and nudge them toward the next one.
Step 3 — Add to cart
Add the eligible variants with the bundle attributes. For volume discount,_appstle_bundles_type is VOLUME_DISCOUNT.
Tier restriction (optional)
When the merchant enables tier restriction, the discount is pinned to one explicitly chosen tier rather than auto-selecting the best qualifying one. In that mode, also attach the selected tier’s identifier:| Attribute | Value |
|---|---|
_appstle_bundle_combo_id | The identifier of the tier the customer selected. |
Only attach
_appstle_bundle_combo_id when tier restriction is enabled for the bundle. Without restriction, omit it and the Function applies the best qualifying tier automatically.Step 4 — Discount applies automatically
Appstle’s automatic discount evaluates the qualifying tiers against the cart and applies the best one (or the pinned tier, under restriction) in cart and checkout. As the customer adds or removes quantity, the applied tier updates automatically — no calls from your side.Previewing the discount
Replicate the best-tier selection for a live preview (cart prices in cents):This preview is display-only. The Shopify Function applies the authoritative discount at checkout from the same tiers, so they agree as long as you read
tieredDiscount from the live rule.Checklist
Next steps
Fixed pricing bundle
Sell a curated set for one fixed price.
Dynamic pricing bundle
Build-your-own with a percentage or amount discount.