Last active
July 21, 2020 09:51
-
-
Save omeome762/c0c4921736cccfe5f3804b81287c81a9 to your computer and use it in GitHub Desktop.
Free shipping for VIP tagged customers, Shopify Script for run free shipping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TAG = "vip" #customer tag | |
MESSAGE = "VIP Customer Reward" #additional message | |
customer = Input.cart.customer | |
if customer | |
if customer.tags.include?(TAG) | |
Input.shipping_rates.each do |shipping_rate| | |
if shipping_rate.name.include?("Insured Shipping and Handling (USPS Priority Express)") | |
shipping_rate.change_name("FREE VIP GROUND SHIPPING (USPS Priority Express)", { message: "" }) | |
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE) | |
end | |
end | |
end | |
end | |
Output.shipping_rates = Input.shipping_rates |
Hi There,
How would this work? And where would I have to input this code?
Thanks for your help.
Kind regards,
Menno
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ist cool