Cart-drawer.liquid How to show Free delivery sum minus cart total?

I’m using a default free theme Dawn. I would like my customers to see how much they should spend to get free delivery. For example, free delivery from $100, cart total is $49.10, so there would be a message “You are $50.90 away from free delivery”. This should be done within snippets > cart-drawer.liquid

So I need something like:

-if cart total < 100, then:

–You are ${{ 100 | minus: cart.total_price | money_without_currency }} away from free delivery.

  • else You are eligible for a free delivery.

Hello @hdmidef

This can be custom coded by Script changes So you need to approach a dev. Also if you want you can use any free shipping bar app.

Hi @hdmidef ,

Please add code:

{% if cart.total_price < 10000 %}
          You are ${{ 10000 | minus: cart.total_price | money_without_currency }} away from free delivery.
{% else %}
          You are eligible for a free delivery.
{% endif %}

Hope it helps!

1 Like

Hi,

I have added the below code (highlighted lines) as suggested for a different use case where I want to prevent user from checkout if order value is less than 150. But its not working. Checkout buttons are still showing, as per the code only if the cart.total_price is more than 150, it should show checkout button, if not should show the message in else condition.

can you please assit.

I am using fastor theme.