VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ilfungo on July 17, 2018, 14:51:21 PM

Title: Orders number in product mismatch the real made orders
Post by: ilfungo on July 17, 2018, 14:51:21 PM
Hi I have a strange issue and I am unable to understand where does it come from. Example: I set a product (let's call it A) with an available stock of 100. Now I see A product ordered 50 times in the status tab but I recived only 47 payments. I checked all over the database and 47 actually seem to be the right number of the A buyed product. I tryed to understand where the number in the status tan come from and I looked inside administrator/components/com_virtuemart/views/product/tmpl/product_edit_status.php and I find out the value come from $this->product->product_ordered which I don't konw where it comes from and I can't understand how it is calculated. Obviously before of doing this serch I removed any pending orders.
Title: Re: Orders number in product mismatch the real made orders
Post by: Jörgen on July 19, 2018, 01:19:01 AM
Every time an order is made stock is booked. Every time an order is confirmed the booked is taken from the stock and added to the sold number.
Deleting a pending order the wrong way, or changing in stock and booked the wrong way could mess things up.

available = stock - booked;

regards

Jörgen @ Kreativ Fotografi
Title: Re: Orders number in product mismatch the real made orders
Post by: ilfungo on January 16, 2019, 15:14:34 PM
Hi Jörgen and thanks to your reply, didn't really see it. I know what you mean, in my backoffice there are confirmed orders, cancelled and pending. When an order is pending for more than 1 hour I cancel it as in the shop we only permit credit card  payment. By this way +1 is added by the stock order. However at the end some stock availability is just lost! Nobody changes the stock availability... This relly looks a bug to me. Somebody can help?