How can I limit item quantity to inventory count in my cart?

I need help in quantity button. When customers adding items to the cart the quantity button should stop adding once the inventory been reached. e.g. if I have an item and I have 5 in the inventory. So when customer adds 6 which is more than inventory the button should fade and limit the customer to add more than 5.

URL: https://earthtreasuresusa.myshopify.com

Hello @earthtreasures

It need to add the Max attribute to the quantity box and that Max should be the available quantity of the product, as quantity can vary variant to variant so it need to check the variant specific quantity that can be done using Shopify API’s.. You need to take help from a developer for this. Or let me know if I can help.

Thank you!

Can you help me to develop this code.

Yeah, please share your store URL… I’ll check and let you know.

Thanks!

URL: https://earthtreasuresusa.myshopify.com