Hey everyone,
I’m using a Shopify Function to apply collection-specific discounts based on customer tags. Everything works as expected when a logged-in customer is present.
But here’s the issue:
Even when no discount is returned, the Shopify POS displays:
A green banner saying “Automatic discount added to the cart”
- “DISCOUNT” under the product variant title
- No customer is assigned
- No discount actually applies to the price
This makes it look like our function applied a discount when it absolutely didn’t.
Our logic (summarized):
We’ve verified that nothing is being returned unless the customer passes both checks:
// Early exit if no customer
if (!input.cart.buyerIdentity?.customer) {
return EMPTY_DISCOUNT;
}
// Exit if customer has no valid tags
if (customerTags.length === 0) {
return EMPTY_DISCOUNT;
}
We also verified the config is being parsed correctly, and discounts.length
is zero unless both conditions are met.
My questions:
- Why is POS showing “DISCOUNT” under line items even when the Function returns no discounts?
- Could this be a POS UI quirk, or is Shopify injecting something from automatic discount settings even if it doesn’t apply?
- Any way to fully suppress that label or inspect what’s triggering it?
Happy to share the full function code or logs if needed. Right now, we’ve completely ruled out our function as the cause — it’s returning EMPTY_DISCOUNT
when no customer is logged in, as it should.
Thanks for any insight.
— Drew