Skip to content
Forged Commerce, home
Demo buildShopify B2BDiscount FunctionVolume tiers

Northstar

10% from 25 units and 15% from 50, on a demo dev store

Industry
B2B, Shopify dev store
Architecture
Shopify Discount Function. Tiers in the app metafield $app:volume_tiers. The Function and the cart UI use unit-tested shared tier logic. Checkout extension included, needs Shopify Plus for checkout steps.
Technology
ShopifyShopify B2BShopify FunctionsCheckout UI extensionTheme app block

Screenshots from a demo dev store.

  • Demo dev store
    Demo dev store cart at 20 units.
    20 units. Add 5 more items to get 10% off. No discount.
  • Demo dev store
    Demo dev store cart at 30 units.
    30 units. 10% (25+) applied, -$147.60, total $1,328.40. Add 20 more items to get 15% off.
  • Demo dev store
    Demo dev store cart at 60 units.
    60 units. 15% (50+) applied, -$442.80, total $2,509.20. You're getting 15% off (top tier).

The problem

A logged-in B2B buyer needs the next volume tier in the cart, and the Discount Function has to apply those same thresholds.

The system

The tiers sit in the app metafield $app:volume_tiers: 10% at 25 or more units, 15% at 50 or more. The cart theme app block reads that definition and is shown only to logged-in B2B buyers. Checkout extension included, needs Shopify Plus for checkout steps.

The implementation

  1. 01Store the volume tiers in the app metafield $app:volume_tiers
  2. 02Apply 10% at 25 or more units and 15% at 50 or more with a Shopify Discount Function
  3. 03Use unit-tested shared tier logic in the Function and the UI
  4. 04Show tier progress in a cart theme app block, only for logged-in B2B buyers
  5. 05Checkout extension included, needs Shopify Plus for checkout steps
  6. 06Verify the cart on a Shopify dev store at 20, 30 and 60 units

The result

Below 25 units
Progress prompt, no discount
30 units
10% applied
60 units
15% top tier

Key learnings

  • 01The cart prompt and the Discount Function share one tier definition in $app:volume_tiers
  • 02Unit-tested shared tier logic keeps the Function and the cart on the same thresholds
  • 03The cart block is shown only to logged-in B2B buyers

Next

Recognise the problem?

Tell us where your store is constrained and we will tell you what it takes to fix it.