1

I have to display the 0 quantity size product in frontend but addtocart button is missing.
How can i add 0 quantity product to cart in Magento 2?

  • You cannot add the product to cart if its quantity is zero. However what you can do is go to backend catalog->products->manage products->select the particular product and increase the quantity of product in inventory and make it in stock. After that clear the cache and check again you will be able to add product in cart – surbhi agr Mar 12 at 9:14
  • But my requirements add 0 quantity product to cart – Soundararajan m Mar 12 at 9:38
  • 1
    "Out of stock" product you can add to the cart for this you need to enable Backorders. – Amit Naraniwal Mar 12 at 9:43
  • Basically, if you add a product to the cart, it means you want to buy it and at least "1" it makes no sense to buy a product with "0" quantity – PЯINCƏ Mar 12 at 9:48
  • @Soundararajanm you can go to catalog->products->manage products->select the particular product ->advanced inventory->and set backorders to Allow quantity below 0. Then clear cache,run indexing and check it again – surbhi agr Mar 12 at 9:49
2

Hello @Soundararajanm,

You cannot add the product to cart if its quantity is zero without backorders being enabled. However what you can do is go to backend catalog->products->manage products->select the particular product and increase the quantity of product in inventory and make it in stock. After that clear the cache and check again you will be able to add product in cart.This will make add to cart button enabled for you.

  • Yes working fine. Already we commented in above answer – Soundararajan m Mar 12 at 12:16
  • if it works for you please upvote so that other can also be benefitted from it :) – surbhi agr Mar 12 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.