Skip to content

Shopify Dude Fix

Shopify Automatic Discount Is Off but the Sale Badge Still Shows: Sync Promotion State

Deactivating a Shopify Function discount does not clear product metafields or theme sale prices. Connect native discount status to storefront display and test both paths.

Quick answer

On this page

Deactivating a Shopify automatic discount stops that discount from being eligible for cart and checkout. It does not rewrite product metafields, change a theme’s sale badges, or reset custom prices your storefront is displaying. If your promotion uses both a Shopify Function and metafield-driven theme presentation, those are two separate systems. Give them an explicit synchronization contract rather than assuming the native discount switch changes both.

Why a deactivated discount can still look active

A merchant turns off an automatic discount in Shopify Admin. The Function stops awarding its discount, yet the product page still displays “Sale” and a lower promotional price. The shopper adds the item and sees the normal price in the cart. That is not a checkout-calculation bug: the theme is rendering stale merchandising state.

Automatic discounts have their own lifecycle and status. Shopify exposes that status through the GraphQL Admin API, and discountAutomaticDeactivate deactivates an automatic discount. Product and shop metafields are independent persisted data. Liquid does not automatically look up the discount’s live status when rendering a product card. The familiar compare_at_price field is independent too; it is not the discount engine.

The same mismatch can happen in reverse. The Function may be active while a product metafield is false, so checkout discounts an item that the storefront never advertises as on sale. This is why testing only the cart or only the product page misses the defect.

Start by identifying the actual source of truth

Record the discount node ID, the app Function responsible for calculation, the product eligibility field, the promotional display-price field, and every theme surface that reads them. Usually that means product cards, the PDP, quick-add, search results, recommendation blocks, and the cart drawer. Identify whether the cart displays a pre-discount line price, a final line price, or a hand-built promotional amount.

Do not assume that custom.sale_active = true means the Shopify discount is active. It means only that the product field currently contains true. A product can remain marked eligible long after a promotion has ended.

Two workable architectures

Option A: Keep eligibility on products and mirror one promotion-level state

The app maintains product eligibility and promotional values in metafields, while also writing a single storefront-readable promotion flag (for example a shop-level boolean metafield). The theme renders promotional pricing only when both the promotion flag and product eligibility are true. This is a small, fast display gate and avoids updating hundreds of products on every pause. It is a mirror, not a direct Liquid query of the discount node.

{% assign promotion_live = shop.metafields.custom.promotion_live.value %}
{% assign product_eligible = product.metafields.custom.sale_active.value %}
{% if promotion_live and product_eligible %}
  <span class="sale-badge">Sale</span>
{% endif %}

This example controls a badge, not the final numeric price. Apply the same combined condition wherever a custom promotional amount is rendered, and use the correct money metafield type and currency handling. It assumes an app or workflow actually updates promotion_live; creating the field alone does nothing.

Option B: Automatically synchronize product flags on discount changes

If the product metafield must be the sole theme signal, the app can react to discounts/update, re-read the discount node’s authoritative status, and update the products belonging to that promotion. Keep a durable membership list of product or variant IDs associated with the promotion before turning it off. Otherwise, after you set every sale_active value to false, you may no longer know which products to reactivate.

Use a stable promotion ID rather than the discount title as the relationship key. A discount can be renamed. For large catalogs, batch updates, persist progress, retry failures, and reconcile periodically. A webhook is a useful signal, but it should not be your only recovery mechanism. The storefront will be eventually consistent while product updates are processing.

Whichever option you choose, keep Shopify’s automatic discount status authoritative for whether the Function can discount. Do not try to “deactivate” a Function by changing theme JavaScript. And do not update compare_at_price merely to imitate a promotional badge unless you actually intend to change the product’s comparison price.

Check the discount status with GraphQL

query DiscountState($id: ID!) {
  discountNode(id: $id) {
    id
    discount {
      ... on DiscountAutomaticApp {
        title
        status
      }
    }
  }
}

Pass the discount node GID as $id, use an Admin API token with read_discounts, and inspect the returned status. The fragment above is specifically for app-managed automatic discounts. A native basic automatic discount uses a different union member. Treat the query as an admin-side verification step, not something to run from storefront Liquid or browser JavaScript.

Make the transition safe

For an immediate off switch, prefer a small promotion-level mirror plus an app-side reconciliation job. If the business insists on product-only flags, explicitly accept the propagation delay and monitor it. Preserve a promotion-to-product manifest so a later activation can restore exactly the intended group, even if a merchandiser changed eligibility during the pause. A sensible reconciliation process compares discount status, intended membership, and current metafields, then logs the differences before changing data.

Common misunderstanding

“Shopify’s Deactivate button turns the sale off everywhere.” It turns off the discount’s eligibility in Shopify’s discount system. It does not know which custom sale price, badge, banner, search tile, or metafield your theme invented. That presentation layer needs a deliberate connection to promotion state.

How to test this

  1. Use a test product with a normal price and a visibly different promotional price. Record the discount ID and metafield values.
  2. Activate the discount. Confirm the PDP, collection tile, search result, quick-add, cart drawer, cart, and checkout agree about the promotion.
  3. Deactivate the discount using Shopify’s native control. Confirm the Admin API status changes, the cart/checkout discount disappears, and every storefront sale signal clears after the documented sync window.
  4. Reactivate it and confirm only the intended products return, including a product added or removed from the promotion during the pause.
  5. Test a missed or duplicated webhook, a failed metafield write, and a partial batch. The reconciliation job should recover without incorrectly re-enabling other products.
  6. Repeat for a different market/currency, a different variant, and one-time versus subscription purchase types if applicable.

Sources and further reading

Technical references checked October 26, 2026.