Error on Shopify Scripts Coupon code.

Shopify Partner
221 0 13

Hey guys,  I am working on some scripts to filter out certain payment method if a discount coupon is used. But when I test the script it shows me this errors:

Discount code requirements not met (Your cart)
Discount code requirements not met (Empty cart)
Discount code requirements not met (No customer)

Any idea why this is? Its only a free shipping coupon with no exception rules. So how am I getting this error?  Your help is much appreciated 

Entrepreneur, Developer, Geek, Gamer and very passionate about WEB development! :P

Need help with your Shopify Store? Contact me: jfeuchter@gmail.com :D
0 Likes
Shopify Expert
19 0 1

I'm getting the same error. It occurs for me whenever I enter a free shipping discount code into the Script Input, even if the code has no requirements to use and even if the script itself is basically blank:

Output.shipping_rates = Input.shipping_rates

Which leads me to believe this is a Shopify error that can't handle Free Shipping discount codes in the Script Editor input for testing, for some reason. Hope this is fixed soon.

0 Likes
Highlighted
Shopify Partner
221 0 13

Hey K&J, I found out that adding an {% if %} to check if there is a coupon code on the cart before using any coupon code value acutally fixes the problem. Eitherway, if you published a script with that error, there should not be any problem with it. I would suggest using the script preview to see how your script works on your live store just to be on the safe side. But like I said adding the if to check if the coupon code exist usually fixes the problem :D Best of lucks! :D 

 

Cheers!

Entrepreneur, Developer, Geek, Gamer and very passionate about WEB development! :P

Need help with your Shopify Store? Contact me: jfeuchter@gmail.com :D
0 Likes
New Member
2 0 0

Jurgen, any way you can show me the code snippet of what that {% if %} looks like?

0 Likes