Free Shipping

Highlighted
Tourist
11 0 1

How do I apply free shipping if cart total is 75?

Shopify Task starting at $25 Submit Your Edits
0 Likes
Highlighted
Shopify Expert
9930 105 1766

Hey Lita,

What is the code you have at the moment that isn't working?

The docs have examples that can give you some early tips on getting started.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Tourist
11 0 1

This is the code I am using

MINIMUM_ORDER_AMOUNT = 90 #dollars required in cart to get discount
MESSAGE = "Free shipping if order is over $100" #promotional message

if Input.cart.shipping_address.country.include?("United States")
  if Input.cart.subtotal_price_was >= (Money.new(cents:100) * MINIMUM_ORDER_AMOUNT)
    Input.shipping_rates.each do |shipping_rate|
      next unless shipping_rate.source == "shopify"
      shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE)
    end
  end
end

Output.shipping_rates = Input.shipping_rates

Shopify Task starting at $25 Submit Your Edits
0 Likes