How to use the script to offer a fixed amount discount to the shipping rate

Roy-2021
New Member
1 0 0

I am trying to give a $6 discount to customers from my state. Figured out how to give a percentage discount, however do not know how to give a fixed amount discount. The code below gives an error: 'float can't be coerced into Money (Your Cart)'

if shipping_rate.name == ("shipping")
shipping_rate.apply_discount(shipping_rate.price-6.0, message: "Discounted Shipping Rate")
end

 

Please help.

 

 

Replies 0 (0)