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.
1 Like
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 CodeFrom 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 CheckLocate 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 %}
Your current order total is below the minimum required amount of £{{ min_order_amount }}. Please add more items to your cart.
{% 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.
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.