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.
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.
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.
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.
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:
where the example numbers 123456789 and 012345678 are variant IDs.
I found that this link format requires having at least 1 variant ID in it for it to work.
Unfortunately, if you only have the discount code in the link, it seems to have no effect.
Also unfortunately if you are just trying to add a discount code, the link format will overwrite any products in the cart and discounts that are already applied, so you need to ensure the link includes all products that are already in the cart and all discounts that have already been applied, as well as the new discount.