Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Inventory management

Inventory management

Timadewale
Shopify Partner
9 0 0

I've set "Product1" to have inventory of 5 (and and I'm not allowing it be still sold when out of stock). However, the user can keep clicking the + on the product amount (whereas I want it to stop being able to be increased once the user has selected 5). It doesn't allow you to add more than 5 to the cart (an error message pops up), but I don't want this to happen - I only want the max number of inventory to be able to be selected in the first place. Also if a product only has an inventory of 1, it should just advise "add to cart" rather than give an option of being able to increase the number that you want to try add to cart. So I'd like it to stop increasing when it hits my max inventory, for example this item only has 5 so I shouldn't be able to click + anymore after 5

I've seen Shopify stores do this correctly - does it depend on the theme? As it seems like a basic online store thing to have. I'm using Sense theme. Thanks in advance!

 

I want it to work on my product pagephoto_5931626681234211928_y.jpgphoto_5931626681234211927_y.jpg

Replies 2 (2)

theycallmemakka
Shopify Partner
1720 416 434

Hi @Timadewale ,

 

To limit the user from changing quantity to maxinventory, you will have to update main-product.liquid file. Please follow below steps to update this.

 

Step 1: Open main-product.liquid and go to line 275.

Seep 2: Add below code on line 275

{% if product.selected_or_first_available_variant.inventory_policy == 'deny' %}
                        max="{{ product.selected_or_first_available_variant.inventory_quantity }}"
                        data-max="{{ product.selected_or_first_available_variant.inventory_quantity }}"
                        {% endif %}

theycallmemakka_0-1732977623147.png

 

Step: Save the changes.

 

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Makka

 

 

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

Timadewale
Shopify Partner
9 0 0

Thanks it is working now