I implemented the solution from the provided documentation to apply automatic discount codes for segmented customers upon sign-in. I understand that Shopify’s native functionality applies automatic discounts universally, not for segmented customers.
While the documentation’s code works as intended, an issue arises when customers sign into their accounts via the checkout page. In this scenario, the discount does not automatically apply.
Most customers tend to sign in at checkout rather than earlier in their journey. To apply the discount, they currently need to navigate back to the homepage and return to the checkout page, which creates a poor user experience and appears glitchy. Is there a way to modify this code so that the automatic discount works seamlessly, even when the customer signs in directly at the checkout page?
The issue here is that the JavaScript-based discount application workaround has significant limitations that aren’t often discussed. While it’s a popular approach, Shopify doesn’t allow for custom code at checkout unless you’re on Shopify Plus and using a Checkout UI extension—not just a simple fetch(‘/discount/CODE’) snippet. This means that the code snippet from the article won’t be triggered at checkout. This limitation often creates a frustrating user experience, as you’ve described.
Instead of spending time on this workaround, consider using an actual automatic discount solution designed for specific customers. Our app, Regios Discounts (4.9 stars, 70 reviews, Built for Shopify), solves this seamlessly.
While we can’t directly use Shopify segments due to Shopify Functions API limitations, our app supports customer tags, metafields, order count, location, and more. You can use Shopify Flow to tag customers automatically based on specific criteria, and our app will apply the discount seamlessly in the cart and checkout—even when customers sign in at checkout.
Thank you for you reply.
I understand where you coming from but paying $100/mo for this small functionality is very expensive…
Since I only need this 1 feature I’m looking for a custom code solution that wouldn’t require me to pay for Shopify Plus or a pricey app.
Just to clarify, our $99/mo plan applies only if you’re applying discounts to over 1000 orders per month through our app, which would be quite fair considering the sales volume enabled by our app in that case. For lower volumes, our plans start at $29.99/mo or $49.99/mo without taking a percentage of your sales.