Minimum order value - Trade Theme 15.3.0

Minimum order value - Trade Theme 15.3.0

Adam_APC
Visitor
1 0 1

I would like to implement a minimum order value (at cart level) without using apps. The minimum order value is £40. Can this be achieved by editing the theme code - if so, what and how do I need to add?

 

To summarise, the total cart value must be greater than £40.00 before an order can be placed.

Replies 2 (2)

BiDeal-Discount
Shopify Partner
569 66 140

Hi @Adam_APC 

 

Yes, you can implement a minimum order value of £40 at the cart level without using apps by editing your theme’s cart template. The common approach is to add Liquid code in your cart-template.liquid (or cart.liquid) file that checks the cart total and prevents checkout if the minimum is not met.

Here’s a simple and effective example based on community solutions:

Step-by-Step Guide to Add Minimum Order Value (£40) in Shopify Theme Code

1. Access Your Theme Code

From Shopify admin, go to Online Store > Themes > Actions > Edit code.
Open the file that renders your cart page, usually named cart-template.liquid or cart.liquid under the sections or templates folder.

2. Add the Minimum Order Value Check

Locate the code that outputs the Checkout button. Just before this button, insert the following
Liquid code snippet:
{% assign min_order_amount = 40 %}

{% if cart.total_price < min_order_amount | times: 100 %}
  <p style="color: red; font-weight: bold; margin-bottom: 10px;">
    Your current order total is below the minimum required amount of £{{ min_order_amount }}. Please add more items to your cart.
  </p>

  <style>
    /* Hide the checkout button when minimum order not met */
    .btn--checkout, 
    input[name="checkout"] {
      display: none !important;
    }
  </style>
{% endif %}

 Explanation:

  • cart.total_price is in cents/pence, so we multiply the minimum amount by 100 for comparison.

  • If the cart total is less than £40, a red warning message appears and the checkout button is hidden, preventing users from proceeding.

  • When the cart total meets or exceeds £40, the checkout button appears normally.

3. Save and Test

  • Save your changes.

  • Add products to your cart and try to checkout with less than £40 total-you should see the warning and no checkout button.

  • When the cart total is £40 or more, the checkout button should appear and function normally.

Additional Tips

  • You can style the warning message and button hiding to fit your theme’s design.

  • For themes using AJAX cart or drawer carts, you may need to add similar checks in those templates or use JavaScript to enforce the rule dynamically.

  • This method works well for stores not on Shopify Plus, as checkout.liquid customization is restricted.

  • For a more robust solution (including blocking checkout on the backend), Shopify Plus merchants can use Shopify Scripts or Checkout Extensions.

- Helpful? Like & Accept solution!
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Bify app: Shopify automatic discount solutions
- Contact me? support@bify.app or WhatsApp: +84974709330

devcoders
Shopify Partner
1459 173 454

Hello @Adam_APC 

Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.

Shopify Developer: Helping eCommerce Stores
If you need assistance with your store, feel free to contact us at devcodersp@gmail.com
WhatsApp No: +91 8516919310 If my assistance was helpful, please consider liking and accepting the solution. Thank you!