Field guide · Compare-at pricing

Shopify discount off compare-at price, without stacking on sale items

Shopify’s discount engine ignores the compare-at price and applies straight to the current price. So a 20% off code on a $100 item already on sale at $80 takes another 20% off, charging the customer $64 instead of $80.

Short answer

  • Shopify can’t natively discount off the compare-at price.
  • Solo Discount adds two modes that fix this: discount off compare-at (with a floor), or skip variants already on sale.
  • Both run as a Shopify Function at checkout. Works for codes and automatic discounts.

Why this happens

Shopify treats the compare-at price as a display field, a strikethrough hint for your theme. It isn’t a discount, and the checkout doesn’t know about it. So when a customer applies a code or an automatic discount, the math runs against price, not compareAtPrice. If you’ve lowered price below compareAtPrice to show a sale, every additional discount stacks on top.

The native workarounds break in common cases:

  • Markets. Pricing varies per region; collection rules can’t capture that.
  • Sitewide sales. Moving every product into and out of an “eligible” collection is brittle.
  • Wholesale and VIP codes. You want “50% off retail,” not “50% off marked-down,” but Shopify can only do the latter.
  • Ditch compare-at entirely. Works in theory, but you lose strikethrough prices, which kills perceived savings.

Two patterns merchants actually want

There’s no single “right” answer. The intent depends on the promotion, so Solo Discount supports both modes, switchable per discount.

Mode 1 · Discount off the compare-at price (with a floor)

Calculate the discount as a percentage or fixed amount off the compare-at price. If the current price is already lower than the discounted-from-compare-at target, no further discount applies, so customers never pay more than the visible sale price.

Worked example · 40% off code, mode = compare-at

Acompare-at $100 · current $8040% off $100 → target $60$60discount applies
Bcompare-at $50 · current $4040% off $50 → target $30$30discount applies
Ccompare-at $50 · current $20target $30 · current already below$20floor protects
Dno compare-at · current $45basis $45 → 40% off$27discount applies

Mode 2 · Skip variants already on sale

Apply the discount only to variants at full price (current price equals compare-at, or no compare-at set). On-sale variants are skipped entirely, so the discount only touches full-price items. This is usually the cleaner choice for sitewide promos where you don’t want to negotiate against your own markdowns.

Built-in vs Solo Discount, side by side

Same item: compare-at $100, current price $80. Customer applies a 20% off code.

Shopify built-inSolo Discount
Math basiscurrent price ($80)compare-at ($100)
20% applied$80 − $16 = $64target $80 → no extra discount
Customer pays$64$80
Effective markdown36% off retail20% off retail

Why a Shopify Function

Both patterns have to run during checkout pricing, after Shopify computes line subtotals and before the cart total is finalized. Theme-level workarounds (Liquid, JavaScript on the product page) can’t do this. They don’t run at checkout, where it actually matters.

Solo Discount runs as a Shopify Function. The logic executes on Shopify’s infrastructure, on every cart, with no theme dependency and no performance hit. Any storefront that uses Shopify checkout (standard, Shop Pay, Hydrogen) gets the same behavior.

Use cases

01

Wholesale & VIP pricing

Negotiated 50% off retail for tagged customers, calculated against compare-at, regardless of whether the item is currently on sale.

Compare-at mode

02

Sitewide promo, no stacking

“10% off everything” without your existing sale items getting an extra 10% on top. Full-price items get the discount; on-sale items keep their existing markdown.

Skip-on-sale mode

03

Markets with regional pricing

Per-variant evaluation at checkout. Market-level pricing differences are handled automatically, with no collection rules to maintain and no per-market discount duplication.

Either mode

Frequently asked

  1. Does this work with discount codes or automatic discounts?

    Both. The protection strategy applies the same way regardless of how the discount is triggered.

  2. Does it stack with shipping or other discounts?

    You control stacking via Shopify’s standard “combinations” setting on each discount. Solo Discount respects whatever you configure there.

  3. Does it work on Hydrogen or custom storefronts?

    Yes. The function runs at Shopify checkout, so any storefront using Shopify checkout (standard, Shop Pay, Hydrogen) gets the same behavior.

  4. Does it support fixed amount off, or only percentage?

    Both. Fixed amount works the same way: calculated off compare-at, with the floor.

  5. Where do decisions happen, at the product or variant level?

    Variant. A product with one full-price variant and one on-sale variant gets the discount on the full-price variant only.

Stop double-discounting your sale items.

Install on the Shopify App Store