Free Shipping

Lita
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
Jason
Shopify Expert
10296 146 1949

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.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Lita
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