Hi, I am working with same app , evertything is working fine even form action is also showing
<form action="/cart?discount=twopercent" method="post" id="cartform">
discount querystring but after that when its redirecting to checkout page, discount is not automatically applying on price and its not working. Please help to resolve this issue.
If anyone is uncomfortable implementing this and can't afford to hire an expert at the moment, I just wanted to pop-in and let you know there is an app that can help facilitate: https://apps.shopify.com/autofill-discount-from-url
But amazing guide! I'm going to be bookmarking it for myself. ;)
@rvtech Is twopercent an active discount in your store? Also, what is your store url? That will help us investigate your issue.
ok thanks Paul
I thought this should pull from our discount codes that we created in the admin panel.
I have gotten the discount to work if I set this line <input id="discount_input" type="hidden" name="discount" value=" "> to a specific discount code in ("name="10percentoff" for example). How do I get this to automatically apply the discount code from the url?
Maybe I missed this in the thread... but i'm not sure I saw anything about it.
Hi Valeriy, I would start completely over and make sure you are reading through every part of this tutorial correctly and that you understand what the code is actually doing. If any of these steps are confusing I would very strongly recommend hiring a Shopify Expert [I’m not one!] to help out. The whole point of this tutorial is to have the customer click a link, which then stores your discount code [which you should have already created on your Shopify backend] and applies it to the Shopify checkout URL once the customer reaches checkout. Manually hard-coding your discount into your website code [if that’s what you’re doing] defeats the whole purpose of the tutorial. ;)
Valeriy Volkov, hopefully all is right and you just have to read over this tutorial, but if you want to delegate and finish then this is one of the customizations I provide, reach out to me by the email in my signature.
But if you do everything to the letter and still get problems remember to provide a storefront password so forum volunteers can take a look.
Thanks for this share --
Unfortunately, on the Retina theme, no love.
I made the edit to the cart script, to match the form id
document.getElementById('cart_form').action = "/cart?discount=" + sessionStorage.getItem("discount");
But still no love.
I also tried the two apps that claim to accomplish this, neither worked.
Anyone get this working with Retina (or other Out of the Sandbox theme) ?
Hey guys, I read all this thread and felt so much the pain that my team and I've decided to build it. Stop struggling with code or coupon code, try this free app instead: https://apps.shopify.com/automatic-discount-rules. The difference between our app and the one mentioned by the Shopify employee above is that it works :) You can apply a discount automatically from a link (Discount URL), but also based on the cart content (amount spent, total number of items or similar items, weight of the order and more to come based on your feedback). That means you can create discounts for customers buying more than $X or buy 2 items and get the 3rd one for free or if your order is really heavy, you get X% off. The app is in beta and we already received great feedbacks for future features. Check this out: https://apps.shopify.com/automatic-discount-rules