How do I drive discount tiers from a metafield?
If an ERP, PIM or product import already owns your volume pricing, the app can read tier quantities and discounts from a metafield instead of you typing them into every deal. The metafield can sit on the product, on each variant, or both; a variant’s own tiers win over the product’s. Turn on “Populate tiers from metafield” in the deal’s Metafields section. The app then reads the JSON metafield custom.volume_discounts, in the shape [{"min_qty": 12, "discount_percent": 2.0}]. Each value can be a percentage off, an amount off each item, or a target price per item, for example [{"min_qty": 1, "price": 54}, {"min_qty": 3, "price": 50}, {"min_qty": 5, "price": 48}] for £54, £50 and £48 per unit. The deal still owns everything visual: labels, badges, layout, colors. One deal can therefore present tiers that differ product by product and variant by variant, which is how wholesale price lists usually work, without a separate Shopify discount for each SKU. Metafield-driven tiers are part of the Professional plan.
Steps
- In Shopify, define a metafield with namespace custom and key volume_discounts, of type JSON. Define it on products, on variants, or on both if some variants need their own tiers.
- Have your ERP or import write the tier list to it, for example [{"min_qty": 12, "discount_percent": 2.0}, {"min_qty": 24, "discount_percent": 5.0}]. For per-variant prices, write each variant’s list to the variant metafield, for example [{"min_qty": 1, "price": 54}, {"min_qty": 3, "price": 50}].
- To bulk import product tiers, use Shopify’s product CSV: once the metafield is defined, exports include a column headed Volume discounts (product.metafields.custom.volume_discounts). Put the JSON list in that column and import the file. Shopify’s product CSV does not carry variant metafields; for those, use the variant bulk editor or Matrixify, with a column headed Variant Metafield: custom.volume_discounts [json].
- In the app, open the deal and choose Metafields in the settings rail.
- Turn on “Populate tiers from metafield”. Metafield namespace and Metafield key are shown read-only. “Manage metafield definitions” opens the matching screen in your Shopify admin.
- Set “Quantity field name” and “Discount field name” to the keys used in your JSON, for example min_qty and price.
- Choose the “Discount type” that matches the values: “Percentage off”, “Amount off each item”, or “Target price per item” when the value is the price a customer pays per unit.
- Choose a product and use “Refresh preview tiers” to confirm the app reads what you expect.
- Set the labels, tags, layout and design on the deal as usual. None of those come from the metafield.
- Save the deal, then check a product that carries the metafield on the storefront and through a test checkout.
What to watch out for
- The namespace and key are fixed at custom.volume_discounts. The field names inside the JSON are yours to choose; the metafield path is not.
- Only the tier quantity, the discount value and the free quantity come from the metafield. Labels, badges and design stay on the deal.
- The metafield is read live at checkout on product- and collection-scoped deals, so an ERP or import change takes effect immediately.
- A product with no valid entries in the metafield gets no discount and no widget from this deal. The tiers set on the deal are not used as a fallback. A variant with no tiers of its own uses its product’s.
- For “buy X, get Y free” entries in the same metafield, see the free items guide.
- Target prices are applied as a discount on the line, so the cart and checkout show the regular price with the discount next to it. A tier whose target price is at or above the current price gives no discount.
- Amounts and target prices are set in your store’s default currency.
- Professional plan.