VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: wyder on February 23, 2019, 09:18:44 AM

Title: Adding more products to the basket than it is available
Post by: wyder on February 23, 2019, 09:18:44 AM
there is a product in the store that has only two items available to buy
the logged-in customer adds two pieces to the basket - everything is ok, he can not add more
then the client logs off
after logging out, he adds two more items to the cart as an unlogged user (he can not add more)
after re-login in the cart there are 4 products and you can order 4, although only two items are possible to order

Joomla 3.9.2
Virtuemart 3.4.2
Title: Re: Adding more products to the basket than it is available
Post by: GJC Web Design on February 23, 2019, 11:29:06 AM
assume it is a bug .. I guess the re-added "old cart" is not checked against stock when added to the current cart

can u actually checkout with the 4?
Title: Re: Adding more products to the basket than it is available
Post by: diri on February 24, 2019, 08:52:38 AM
edit because of further thinking about it ...

IMHO multiple orders of products running out of stock are correct when there is nothing like a check of reservation or confirmation of orders - stock isn't touched than. A message like "sale reserved" should be shown in case products without stock cannot be ordered.

Another possibility causing such behaviour is a setting in backend of VM "products without stock can be ordered". AFAIK it's a "global" setting. I'm not aware to have chance to apply it on single product(s) only without modyfing VM.

cu, diri
Title: Re: Adding more products to the basket than it is available
Post by: Studio 42 on February 24, 2019, 11:58:35 AM
I think that you can solve it.
Check the stock in the layout and add a Joomla message : "sorry you have 4 MY PRODUCT in the basket and only 2 are available. the quantity was set too 2" and modify the column quantity to 2 for eg.