I'd build a Cart Transform Function that reads bulk pricing tiers stored on each product's metafield and applies the right discount instantly at checkout. On the storefront, I'd add a tier preview widget so customers see their savings threshold before they buy. The whole thing lives in product metadata — no codes, no manual intervention.
A mid-market DTC merchant sells products where bulk purchases are common and wanted a way to apply tiered discounts based on quantity without requiring customers to enter a code. The merchant needed the discount to calculate automatically at checkout and display the savings tiers to customers in real time as they adjusted quantities.
Four pieces
Cart & Checkout
Bulk Tier Reader
Reads the bulk pricing tier data you've stored on each product and matches it against what's in the cart right now.
Shopify Function + metafield
extensions/cart-transform/src/run.graphqlfunction
query Input {
cart {
lines {
id
quantity
merchandise {
__typename
... on ProductVariant {
id
title
product {
id
title
metafield(namespace: "bulk_pricing", key: "tiers") {
value
}
}
}
}
}
}
}
Store tiers as JSON in the metafield: [{"minQty": 5, "discountPercent": 10}, {"minQty": 10, "discountPercent": 15}]
Cart & Checkout
Tier Discount Logic
Calculates which tier each line qualifies for and computes the exact discount amount per item.
Function script
Storefront
Real-Time Cart Preview
Shows customers the exact savings they'll get at each tier as they change the quantity in the cart or on product pages.