Help!! Error in shipping script

Crane___Canopy
Excursionist
40 0 9

Hi guys!  Here is my shipping script:

cart=Input.cart
if cart.discount_code && cart.discount_code.code == "TESTING321" 
    Input.shipping_rates.delete_if do |shipping_rate|
        next if shipping_rate.code == "Ground Shipping (5-7 days)"
        shipping_rate.name.upcase.start_with?("")
    end
end
Output.shipping_rates = Input.shipping_rates
 

The idea is set up a free shipping code.  If it is used, remove all express shipping options.

In testing, i get this error if the Input includes any discount code:

There is an error with the discount:

  • Id can't be found

Thanks!

0 Likes
Jason
Shopify Expert
10039 119 1874

I'd need to check ,but I think this is a known issue with the editor (that may be resolved already). If it's what I am thinking of it isn't something that presents itself as an issue to the Customer. 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Chris47
Tourist
3 0 0

Hi Jason, any word on this one? Myself and a couple of others are having what seems to be similar issues in another thread, would be great to get some feedback! Thanks!

0 Likes