Score:0

The "Add to cart" button allows me to add more items to the cart than there are in the inventory

fr flag
MCD

I am trying to work on a Drupal 8 commerce site which was built by someone else. I have not used the Commerce Core module in the past.

Product variation has stock field where I enter total inventory I have. On the product page, I can still add more units to the cart than the inventory I have.

However, I get an error stating that "We do not have xx items in stock." but the item are still added to the cart. For example, I have 10 in stock but I can add 20 items to the cart even I get the error "We do not have 20 items in stock." When I click on Add to cart, other 20 items get added to cart with the same error message.

screenshot

screenshot

screenshot

I should not be able to add more units to the cart than the inventory contains, even if I click on Add to Cart multiple times.

Can you please tell me how to fix the issue?

tonytheferg avatar
cn flag
Have you looked 8n the Commerce stock issue que for similar issues?
MCD avatar
fr flag
MCD
No, I did not see any similar issue listed there.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.