VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: rainman2000 on November 15, 2013, 19:48:19 PM

Title: Apply order status to specific product or category
Post by: rainman2000 on November 15, 2013, 19:48:19 PM
Hi All,

We usually don't deduct stock until the item ships. However, we have some specific items that are for time limited flash sales and we need to subtract the quantity as soon as the item becomes confirmed. So, is there a way to apply the order status to a specific product or category without hacking the code?

Thanks!
Title: Re: Apply order status to specific product or category
Post by: GJC Web Design on November 15, 2013, 21:13:23 PM
Don't think so - the status is set by each individual payment plugin with the function  plgVmConfirmedOrder() normally

$modelOrder = VmModel::getModel ('orders');
$order['order_status'] = "P";
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);


I assume if this is set to C (confirmed) the stock is deducted but haven't checked

Title: Re: Apply order status to specific product or category
Post by: rainman2000 on November 16, 2013, 21:08:38 PM
Thanks. Hopefully someone creates a plugin for this soon.