Removing checkout button when order total is under a certain value

pressurecity
New Member
3 0 0

We're needing to remove the checkout button when the order value is less than $30. We added this code into the cart.liquid which is showing the "Minimum order is $30" at the checkout button but it isn't hiding the button itself.

How can I change this to hide the button as well? 

 

Thanks for any help!

 

{% if cart.total_price < 3000 %}
<font color="#990000">
Minimum order is $30
</font>
{% endif %}
</div>
<a href="collections/all" class="btn btn--secondary cart__update cart__continue--large small--hide" >{{ 'cart.general.continue_shopping' | t }}</a>
<input type="submit" name="update" class="btn btn--secondary cart__update cart__update--large small--hide" value="{{ 'cart.general.update' | t }}">
{% if cart.total_price > 2999 %}
<input type="submit" name="checkout" class="btn btn--small-wide" value="{{ 'cart.general.checkout' | t }}">
{% endif %}

Replies 5 (5)
drakedev
Shopify Partner
680 145 212

At a first look the code seems correct.

Can you share the Shop URL and/or the name of the theme you are using?

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
pressurecity
New Member
3 0 0

Hello, 

 

The url is www.pressurecity.com

The theme is Supply.

 

Thank you for your reply

drakedev
Shopify Partner
680 145 212

Are you sure that you that you don't have an old version of Supply?

I just tried with this code and it is working, check it.

          {% if cart.total_price >= 3000 %}
          <button type="submit" name="checkout" class="btn">
            <span class="icon icon-cart"></span>
            {{ 'cart.general.checkout' | t }}
          </button>
          {% endif %}

          {% if additional_checkout_buttons %}
            <div class="additional-checkout-buttons">{{ content_for_additional_checkout_buttons }}</div>
          {% endif %}

          {% if cart.total_price < 3000 %}
            <div class="minimum-order-notice">
              <span style="color:#990000">Minimum order is $30</span>
            </div>
          {% endif %}

 2020-10-03 02_11_33-Crazy Web Studio.png

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
pressurecity
New Member
3 0 0

It's possible it is an old version. How would I check and update it?"I tried your code with the same result. The text showing order minimum is there but so is the checkout button.

drakedev
Shopify Partner
680 145 212

Mmm I just checked and your versions it's quite a bit outdated.

You are using Supply version 3.3.1

I just download Supply couple of days ago and the version is 9.0.3

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.