Author Topic: Orders number in product mismatch the real made orders  (Read 609 times)

ilfungo

  • Beginner
  • *
  • Posts: 7
  • A beginner
Orders number in product mismatch the real made orders
« 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.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2389
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Orders number in product mismatch the real made orders
« Reply #1 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
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

ilfungo

  • Beginner
  • *
  • Posts: 7
  • A beginner
Re: Orders number in product mismatch the real made orders
« Reply #2 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?