Hi guys! Here is my shipping script:
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)"
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: