VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: prokops on July 25, 2016, 17:51:04 PM

Title: VM limited stock offer and order status problem
Post by: prokops on July 25, 2016, 17:51:04 PM
Hi people!

As this guy states in 2009 (https://forum.virtuemart.net/index.php?topic=50510.msg162366#msg162366), product stock levels seems to be tied to order status.

The "book/ordered" counter goes up once the order is "pending", ie. between checkout and payment.

The problem arises when we want to run a limited product campaign such as a final product fire-sale, we don't want to have products stuck in "pending". Right now the only alternative is to monitor order status manually.

There seems to be two ways to solve our problem.

One is to auto cancel pending orders after x time (https://forum.virtuemart.net/index.php?topic=129639.msg446276#msg446276). This seems not to be possible.

The second and preferred option is to have the stock be controlled by order status "confirmed". The user is informed that the sale is final on completion of the order only. Can this be done by existing means or what are our alternatives?

We run J!3.6, VM 3.0.16.

Cheers!

Title: Re: VM limited stock offer and order status problem
Post by: GJC Web Design on July 25, 2016, 18:12:10 PM
perhaps change something in 

function handleStockAfterStatusChangedPerProduct($newState, $oldState,$tableOrderItems, $quantity) {

administrator\components\com_virtuemart\models\orders.php  ~ 1208 line