Hi,
Pending is not a default status, so you have to change the code in the file "administrator/components/com_hikashop/classes/order.php" function "save()", replace:
if($config->get('update_stock_after_confirm') && isset($order->order_status) && isset($order->old->order_status) && $order_type == 'sale'){
if($order->old->order_status == 'created' && in_array($order->order_status,array('confirmed','shipped'))){
// Decremente product qty
$this->loadProducts($order);
if(!empty($order->products)){
$productClass = hikashop_get('class.order_product');
foreach($order->products as $product) {
$product->change = 'minus';
$productClass->update($product);
unset($product->change);
}
}
}elseif(in_array($order->old->order_status, array('shipped','confirmed')) && $order->order_status == 'created'){
// Incremente product qty
$this->loadProducts($order);
if(!empty($order->products)){
$productClass = hikashop_get('class.order_product');
foreach($order->products as $product) {
$product->change = 'plus';
$productClass->update($product);
unset($product->change);
}
}
}
}
By:
if($config->get('update_stock_after_confirm') && isset($order->order_status) && isset($order->old->order_status) && $order_type == 'sale'){
if( in_array($order->old->order_status,array('created','pending')) && in_array($order->order_status,array('confirmed','shipped'))){
// Decremente product qty
$this->loadProducts($order);
if(!empty($order->products)){
$productClass = hikashop_get('class.order_product');
foreach($order->products as $product) {
$product->change = 'minus';
$productClass->update($product);
unset($product->change);
}
}
}elseif(in_array($order->old->order_status, array('shipped','confirmed')) && in_array($order->old->order_status,array('created','pending'))){
// Incremente product qty
$this->loadProducts($order);
if(!empty($order->products)){
$productClass = hikashop_get('class.order_product');
foreach($order->products as $product) {
$product->change = 'plus';
$productClass->update($product);
unset($product->change);
}
}
}
}