How to limit purchase quantity?

rhizmall
Tourist
8 0 1

I want to limit quantity on orders placed at the website. It will be like customers can't place orders of more than 5 pieces. I am using everything theme

Replies 7 (7)
Rae
Shopify Staff (Retired)
Shopify Staff (Retired)
1166 95 322

Hi, @rhizmall

Rae from Shopify here. I'm glad you reached out about this! I can certainly lend a hand. 

The best way to create limits on product quantities that customers can order is by using an app. Some of the options I recommend checking out for this are: 

Each of these apps can be used to create minimum and maximum order limits on carts, so I believe they will suit your needs well. 

It is important to add however, that these are all third-party apps that are created and fully supported by developers who are external to Shopify. With this in mind, if you have any questions or concerns about using these apps, or the charges associated with these apps, please reach out to the app developers directly for more assistance. 

In the meantime though, I'd love to hear more about the products you're selling, and how you're hoping to use order limits on your site. Will these be used for sale products, or as part of a discount you're running?

Talk soon! 

Rae | Social Care @ 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

rhizmall
Tourist
8 0 1

Glad for your Reply.

Is there any Free app? or any integration/setting which I have to set in cart.liquid file 

Rae
Shopify Staff (Retired)
Shopify Staff (Retired)
1166 95 322

Hi, @rhizmall

Thanks for following up. 

While I don't have any personal experience with free apps that can help set order limits, if any apps like this exist they'll be listed here

In terms of a coding solution, I recommend reaching out to Shopify Experts about this for more information. Experts are third-party developers and coders who are very knowledgeable and skilled with using our platform, so they're a great resource to use for tasks like this. You can contact them via the 'Create a job'  button here

Let me know if there's anything else I can help with! 

Rae | Social Care @ 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

Kumar2573
Shopify Partner
124 6 12

Yes you can do it through custom code
// check tag on products

       {% assign limit = 'no' %}
       {% for tag in product.tags %}  
              {% if tag contains 'limit_' %}    
            {% assign tagName = tag | remove: 'limit_' %}
              {% assign limit = 'yes' %}
               {% break %}
              {% endif %}
           {% endfor %}
 
// Js code
       function getFilterProducts(tag){
             var maxq;
    $.ajax({
        type: 'GET',
          async: false,
        url: '/products/'+tag+'.json',
        dataType: 'json',
        success: function(pdt){
          var pdttags = pdt.product.tags.split(",");
                  var limi = pdttags.find(a =>a.includes("limit_"));
              if(limi){
                limi.split("_");
                limi = limi[limi.length - 1];
                  maxq = limi;
              }
        },
        error: function(status){
          //   alert(status);
        }
    })
   
    return maxq;
    }



  
{% if limit == 'yes' %}
{% include 'quantity-input2', id: section_id, qty: 1, min: 1, max: tagName %}
{% else %}
{% include 'quantity-input', id: section_id, qty: 1, min: 1, max: current_variant.inventory_quantity %}
{% endif %}
Expert Shopify Plus & shopify Developer & Theme customizer
- If the problem is solved remember to click to Accept Solution
- Press Like ?? if the answer was helpful
- Still, Facing issue, Reach out to me Email :- jitendra3496@gmail.com | Skype :- jitendra2573_1
- Direct Hire me :- Direct Contact me
rhizmall
Tourist
8 0 1

i want to know the code which i have to place on my website where customer cannot select more then 5 products on checkout

rhizmall
Tourist
8 0 1

Hi, Kumar

I have placed it in my theme.liquid file also in addtocart.liquid file but it didn't worked kindly guide me where to place this code.

 

Emilia7
Shopify Partner
128 6 19

@Rhizmall Have you got the solution? Though It has been many days still, I’m leaving the reply as it can be helpful for others too. Knowing your requirements as you want to limit quantity on orders, the  MultiVariants - Bulk order can satisfy your need. It has the feature to set minimum-maximum order quantity. Using the app you can apply the limit to a specific product or group of products.

 

Multivariants have other features like limiting the number of variants, min/max order value, bundle quantity, incremental quantity increase, etc. It also gives you control over the style of showing the variants on the product page.

 

Check out this Demo Product where you  need to pick at least 12 products before going to add to the cart: 

 

Image:  MultiVariants Maximum Order QuantityImage: MultiVariants Maximum Order Quantity

 

Emilia7 | eFoli
-Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Checkout our apps:Inkybay || MultiVariants