Personalized checkout and custom promotions with Shopify Scripts
I need a coupon code input on my cart page but it doesn't seem to work in its plain form:
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
I have it right before the submit button, inside the form. Live coupons are not being applied to the order on the checkout page. Is there anything else I need to do for it to work? Edit: The form looks like this —
And it redirects to a URL like this:
<form action="/cart" method="post" class="cart">
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1... it seems there is a conflict that doesn't let the discount apply to the URL or get removed by ?_ga=2.260083023.358228188.1608464294-110675315.1604953057 because when disabling the JS in the chrome setting and submitting the checkout again it works and the discount is getting applied. any thoughts on this? how can I get this working like this: https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1...
thank you
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025