FROM CACHE - en_header

Item quantity limit = min (constant, available inventory)

MisterC
New Member
3 0 0

Hello! I'd like to add a fixed global per-item limit of say 20 (that is, in addition to the existing inventory max limit). So max add-to-cart/in-cart for any item is lesser of 20 and available inventory.

 

Paid app functionality is overkill for my use case and I probably just need an at_most: or similar in the correct spot(s)? Any help is appreciated! Cheers

Replies 9 (9)
LitExtension
Shopify Partner
4365 887 922

Hi @MisterC,

You are wanting the quantity limit to be 20, if the customer enters more than 20 it will automatically revert back to 20 for each product?

Please send me the theme name, I will check and guide you in detail.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Get your 1-month Shopify free trial from LitExtension. CONTACT US!
Are you looking for a solution to migrate to Shopify? Try our FREE DEMO now!
MisterC
New Member
3 0 0

 

@LitExtension Yes, that is exactly the desired function. (And of course if they entered more than 20 and the available inventory was 5, it would return 5). The theme is Drop by We Are Underground.

 

 

LB2022
Tourist
12 1 2

@LitExtension - I also need my cart to limit quantity purchased. I need a minimum limit of 2 and a maximum of 20. I'm only selling one product in my cart. My theme is Debut.

LitExtension
Shopify Partner
4365 887 922

Hi @MisterC,

Does your product have many variants? 

Because when there are many variants you need to add JS to change the max and min of quantity so it will be more complicated requirement and you need to hire expert for it.

Hope it is clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Get your 1-month Shopify free trial from LitExtension. CONTACT US!
Are you looking for a solution to migrate to Shopify? Try our FREE DEMO now!
LitExtension
Shopify Partner
4365 887 922

Hi @LB2022,

You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Get your 1-month Shopify free trial from LitExtension. CONTACT US!
Are you looking for a solution to migrate to Shopify? Try our FREE DEMO now!
MisterC
New Member
3 0 0

@LitExtension 99% of my products have no variants. For the occasional ones that do, if the desired functionality is  problematic/complex, inventory will usually be limited anyways and the standard functionality would be fine.

 

For what I had in mind as possible approach though I wasn't thinking variants mattered. Particularly, the native behavior already handles inventory limitation by variant. No mods needed there. My thought was to add on to the existing logic (that is, item quantity limit = available inventory) an extra check (that is, item quantity limit = min (20, available inventory). Like with an at_most: function or similar. But my attempts failed, ergo here we are lol.

Cheers!

LitExtension
Shopify Partner
4365 887 922

Hi @MisterC,

Please send me the code of product-template.liquid file, I will check and guide it for you

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Get your 1-month Shopify free trial from LitExtension. CONTACT US!
Are you looking for a solution to migrate to Shopify? Try our FREE DEMO now!
LitExtension
Shopify Partner
4365 887 922

Hi @MisterC,

Go to product-buttons.liquid file and add code here:

Screenshot.png

Code:

<label for="{{ section.id }}-productQty-{{ product.id }}">
            {% assign max = 20 %}
            {% if product.selected_or_first_available_variant.inventory_policy == 'deny' and product.selected_or_first_available_variant.inventory_quantity < 20 %}
              {% assign max = product.selected_or_first_available_variant.inventory_quantity %}
            {% endif %}
            <input id="{{ section.id }}-productQty-{{ product.id }}"
            min="1"
            max="{{ max }}"
            data-limit="{% if current_variant.inventory_management == 'shopify' %}{% unless current_variant.inventory_policy == 'continue' %}{{ current_variant.inventory_quantity }}{% endunless %}{% endif %}"
            type="text" name="quantity"
            class="product__quantity-input vib-center"
            value="1" />
            <span class="visually-hidden">{{ 'products.product.quantity' | t }}</span>
          </label>

Hope it helps!

 

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Get your 1-month Shopify free trial from LitExtension. CONTACT US!
Are you looking for a solution to migrate to Shopify? Try our FREE DEMO now!
janvi_22
New Member
20 0 0

Hey @MisterC,

 

This extension Limit Quantity Purchasehelps you to set the maximum and minimum quantities for your store. 

 

The features of this app are as below: 

1. Specific Product purchase limits Minimum and Maximum.

2. Flexible Purchase Limit of items within a group of products.

3. Apply Limit For individual products or collection

 

It has all the features that you have mentioned in your query. Please, check it out here for more details: Shopify Limit Qty Purchase

 

Hope this helps you. 

 

Thank you.