Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save omeome762/c0c4921736cccfe5f3804b81287c81a9 to your computer and use it in GitHub Desktop.
Save omeome762/c0c4921736cccfe5f3804b81287c81a9 to your computer and use it in GitHub Desktop.
Free shipping for VIP tagged customers, Shopify Script for run free shipping
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
@otto4252
Copy link

ist cool

@MennoOTB
Copy link

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