Removing checkout button when order total is under a certain value

Highlighted
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 %}

0 Likes
Highlighted

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 the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes
Highlighted
New Member
3 0 0

Hello, 

 

The url is www.pressurecity.com

The theme is Supply.

 

Thank you for your reply

0 Likes
Highlighted

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 the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes
Highlighted
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.

0 Likes
Highlighted

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 the problem is solved remember to click ✅ to Accept Solution
• Press Like, if the answer was helpful
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
0 Likes