Skip to content

How Checkout Pricing Works (Shopify Functions)

This guide explains how Qivra B2B Wholesale applies your price list discounts at checkout using a Shopify Function, and how it stays in sync with the prices customers see on the storefront.

Qivra B2B Wholesale runs in two places so that what a customer sees is exactly what they pay:

LayerWhereWhat it does
StorefrontProduct/collection/cart pagesRewrites displayed prices in real time
CheckoutShopify checkoutApplies the actual discount to the order

Both layers read the same shop metafield compiled from your price lists, so there is never a mismatch between display and checkout.

At checkout, a cart lines discount Shopify Function runs. It:

  1. Reads the price-list rules from the shop metafield.
  2. For each cart line, finds the matching price list (customer + market + product match, highest priority).
  3. Applies the resolved discount — a fixed amount or percentage off.
  • Customer selection — all / logged-in / guest / by tag / specific.
  • Market selection — all / specific.
  • Product selection — all / collection / tag / specific variant.
  • Per-variant overrides — a fixed price wins absolutely; per-variant discount or price breaks replace the list rule for that variant.
  • Priority — the highest-priority matching list wins.
  • Percentage increase price breaks — Shopify checkout cannot add surcharges, so markup tiers are display-only and do not increase the price at checkout. See Pricing rules.

If the app only changed display prices, a customer could see a discount but pay full price at checkout (or vice versa). By running the same logic at checkout via a Shopify Function, the final total always reflects your B2B rules.

The checkout Function reads the metafield that the Metafield sync panel maintains. When you save or schedule a price list, the metafield is updated and the Function picks up the new rules on the next checkout.

If checkout discounts ever look stale:

  1. Confirm the sync status is Up to date.
  2. Run Refresh all prices from the Advanced panel.
  3. See Troubleshooting: B2B prices not showing.
Play