Re: Again Valid Discount Code Passed As A Query Parameter To Checkout But It's Not Applying To Order

Again Valid Discount Code Passed As A Query Parameter To Checkout But It's Not Applying To Order

vaibhavrathod
Shopify Partner
16 1 9

@DonShopifyGuru @ShopifyGuru1  @Trevor  

 

Again and again, the same issue is happening, the automatic discount code is not getting applied from the cart to the checkout for several merchants, and when our tech team analyzed the cause for this.

 

Keep note - Sometimes is working or sometimes not working, Discount code is available in the query parameter but is not applied automatically in a discount box on the checkout page.

 

https://yourstore.myshopify.com/checkouts/c/e72409b3f943baae3973ddaf47be662b/information?discount=FL...

Replies 11 (11)

romie
Shopify Partner
9 0 8

Facing the same issue.

pierretk
Visitor
1 0 1

We have been experiencing the same issue for the last few days. 

BrioCommerce
Shopify Partner
1 0 0

tobebuilds
Shopify Partner
447 32 120

Hey, it's Tobe from Regios Automatic Discounts.

 

Is there a specific reason you're using discount codes instead of automatic discounts, if you want discounts automatically applied to the user's cart?

 

I'm not 100% sure I understand your use case, but it's possible that with some more details, I could identify the cause. I've done some work using discounts in Shopify recently, so maybe something I learned could be useful, even if it doesn't directly solve your problem.

Founder, Regios Discounts app (4.9 stars, 58 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
AydinTK
Shopify Partner
1 0 0

Hello Tobe!

The situation here,
regarding the address that the discount code was sent to the checkout page.
Ex:
/checkout?discount=XXXXX

This discount code parameter does not always apply the code.

Starshards
Shopify Partner
44 2 14

Shopify removed this feature due to privacy reasons. Instead use the following workaround:

https://store.myshopify.com/discount/DISCOUNT_CODE?redirect=/checkout

//my example
let baseUrl = window.location.protocol + "//" + window.location.hostname;
checkout.attr('href', `${baseUrl}/discount/${discountCode}?redirect=/checkout`);
vaibhavrathod
Shopify Partner
16 1 9

Yes, thank you for your answer

 

But how to apply 2 discount code your example url? Any idea would be great for us.

Matt-ID
Visitor
2 0 0

I have tried this, but it gets stuck and doesn't redirect to the checkout for some reason. I added the url to the form action and it just goes to the page and never redirects.

Starshards
Shopify Partner
44 2 14
Yeah, that’s because Shopify just reverted their code a few days ago. I don’t know what’s going on with their development team, but now the old method works again.
Matt-ID
Visitor
2 0 0

Weird, I reverted back to the old method and it's not working either. Shows the discount code in the url, but not on the checkout page. Any insight would be greatly appreciated. This is what I have on the post action:

 

/cart?discount=[discount code]

vaibhavrathod
Shopify Partner
16 1 9

We are facing the same issue 😕