What's your biggest current challenge? Have your say in Community Polls along the right column.

How can I set a minimum order amount on my website?

How can I set a minimum order amount on my website?

kamm0
Excursionist
21 0 5

Hello Everyone, 

How can I setup a minimum order amount to Rs. 500/-

I dont want any order below Rs. 500/-

Kindly guide me a code or something to do it 

I am also offering free delivery over Rs. 4000, which is already active

I am using Dawn theme

Website is householdpoint.pk

Thanks a lot

Replies 8 (8)

Blair
Shopify Staff
2067 273 253

Hi @kamm0,

 

Thank you for reaching out to the Community. I'm happy to provide some assistance with this request, to ensure it gets resolved. 

 

To successfully achieve this I recommend checking out the Shopify App StoreWe have various apps available that may allow you to complete this. For ease, I've gone ahead and made a few suggestions listed below that you can look into:

 

 

Additionally, I'd also recommend getting in touch with the app developers directly. They will be able to provide clarification on an app's capabilities and customizations to confirm whether or not the app will fit your shop's needs. To get in contact with an app developer, you can head to the Shopify App Store and select Support > Send A Message

 

Please let me know if you have any other questions or concerns. 

Blair | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

StoreWatchers
Trailblazer
205 30 37

Hello @kamm0,

 

Greetings from the Store Watchers Support Team! Happy to help you today.

 

Go to Online Store -> Actions -> Edit code. Then find your cart template.

online-store.JPG

In your cart template file, look for the checkout button code and wrap it with an if condition similar to the one below to hide the button for orders below 500.

{% if cart.total_price < 500 %}
// Your checkout button code here.
{% endif %}

You can also optionally add a custom message if the order is below 500.

{% unless cart.total_price < 500 %}
<p>Minimum order is 500</p>
{% endunless %}

Let me know if need further assistance

Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs
kamm0
Excursionist
21 0 5

hello dear,

can you please guide me a bit more, where should I add this code &  in which file?

I have attached the screenshot of my cart.json template & there is nothing like checkout. 

1.jpg

cart.json contain following code

{
"sections": {
"cart-items": {
"type": "main-cart-items",
"settings": {
"padding_top": 36,
"padding_bottom": 36
}
},
"cart-footer": {
"type": "main-cart-footer",
"blocks": {
"subtotal": {
"type": "subtotal",
"settings": {
}
},
"buttons": {
"type": "buttons",
"settings": {
}
}
},
"block_order": [
"subtotal",
"buttons"
],
"settings": {
}
}
},
"order": [
"cart-items",
"cart-footer"
]
}

 

StoreWatchers
Trailblazer
205 30 37

Hello @kamm0,

 

You can add it in sections/main-cart-footer.liquid.

 

Let me know if need further assistance.

Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs
kamm0
Excursionist
21 0 5

and where should I add or wrap it?

can you please add this in the file which I have attached below?

 

{{ 'component-cart.css' | asset_url | stylesheet_tag }}
{{ 'component-totals.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-discounts.css' | asset_url | stylesheet_tag }}

<div class="page-width{% if cart == empty %} is-empty{% endif %}" id="main-cart-footer" data-id="{{ section.id }}">
<div>
<div class="cart__footer">
{%- if settings.show_cart_note -%}
<cart-note class="cart__note field">
<label for="Cart-note">{{ 'sections.cart.note' | t }}</label>
<textarea
class="text-area field__input"
name="note"
form="cart"
id="Cart-note"
placeholder="{{ 'sections.cart.note' | t }}"
>{{ cart.note }}</textarea>
</cart-note>
{%- endif -%}

<div class="cart__blocks">
{% for block in section.blocks %}
{%- case block.type -%}
{%- when '@app' -%}
{% render block %}
{%- when 'subtotal' -%}
<div class="js-contents" {{ block.shopify_attributes }}>
<div class="totals">
<h2 class="totals__subtotal">{{ 'sections.cart.subtotal' | t }}</h2>
<p class="totals__subtotal-value">{{ cart.total_price | money_with_currency }}</p>
</div>

<div>
{%- if cart.cart_level_discount_applications.size > 0 -%}
<ul class="discounts list-unstyled" role="list" aria-label="{{ 'customer.order.discount' | t }}">
{%- for discount in cart.cart_level_discount_applications -%}
<li class="discounts__discount discounts__discount--position">
{%- render 'icon-discount' -%}
{{ discount.title }}
(-{{ discount.total_allocated_amount | money }})
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</div>

<small class="tax-note caption-large rte">
{%- if cart.taxes_included and shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- elsif cart.taxes_included -%}
{{ 'sections.cart.taxes_included_but_shipping_at_checkout' | t }}
{%- elsif shop.shipping_policy.body != blank -%}
{{ 'sections.cart.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
{%- else -%}
{{ 'sections.cart.taxes_and_shipping_at_checkout' | t }}
{%- endif -%}
</small>
</div>
{%- else -%}
<div class="cart__ctas" {{ block.shopify_attributes }}>
<noscript>
<button type="submit" class="cart__update-button button button--secondary" form="cart">
{{ 'sections.cart.update' | t }}
</button>
</noscript>

<button
type="submit"
id="checkout"
class="cart__checkout-button button"
name="checkout"
{% if cart == empty %}
disabled
{% endif %}
form="cart"
>
{{ 'sections.cart.checkout' | t }}
</button>
</div>

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

<div id="cart-errors"></div>
</div>
</div>
</div>
</div>

<script>
document.addEventListener('DOMContentLoaded', function () {
function isIE() {
const ua = window.navigator.userAgent;
const msie = ua.indexOf('MSIE ');
const trident = ua.indexOf('Trident/');

return msie > 0 || trident > 0;
}

if (!isIE()) return;
const cartSubmitInput = document.createElement('input');
cartSubmitInput.setAttribute('name', 'checkout');
cartSubmitInput.setAttribute('type', 'hidden');
document.querySelector('#cart').appendChild(cartSubmitInput);
document.querySelector('#checkout').addEventListener('click', function (event) {
document.querySelector('#cart').submit();
});
});
</script>

{% schema %}
{
"name": "t:sections.main-cart-footer.name",
"class": "cart__footer-wrapper",
"blocks": [
{
"type": "subtotal",
"name": "t:sections.main-cart-footer.blocks.subtotal.name",
"limit": 1
},
{
"type": "buttons",
"name": "t:sections.main-cart-footer.blocks.buttons.name",
"limit": 1
},
{
"type": "@app"
}
]
}
{% endschema %}

 

AmyChikate
Visitor
2 0 0

i am having same issue can you help me

sir

medusejalouse
Visitor
1 0 0

I got this working, but when the cart is updated with >500 worth of products, the buttons remain missing even when i clear the cache, etc. What have I done wrong?? 😭

JimJong
New Member
56 0 0

You can set a minimum order amount using the Cart Lock https://apps.shopify.com/cart-lock app. Follow the below steps:

 

  1. Open the app and click on the "Add a new rule" button.
  2. Click "Add a new condition" and select the "Cart subtotal" option.
  3.  Set 500 in the "Block if less than" field.
  4. In the "Error message" field, add an appropriate message which will be displayed in the checkout page.
  5. Save the rule.

limitless500.jpeg

 

Now no one can order for less than Rs. 500/- from your store.