// Warehouse: fixed queries. AdminPPreferencesController: fixed advanced stock management
This commit is contained in:
@@ -280,5 +280,20 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
$_POST['PS_ORDER_OUT_OF_STOCK'] = 1;
|
||||
$_POST['PS_DISPLAY_QTIES'] = 0;
|
||||
}
|
||||
|
||||
// if advanced stock management is disabled, updates concerned tables
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 1 &&
|
||||
(int)Tools::getValue('PS_ADVANCED_STOCK_MANAGEMENT') == 0)
|
||||
{
|
||||
Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'product`
|
||||
SET `advanced_stock_management` = 0
|
||||
WHERE `advanced_stock_management` = 1');
|
||||
|
||||
Db::getInstance()->execute(
|
||||
'UPDATE `'._DB_PREFIX_.'stock_available`
|
||||
SET `depends_on_stock` = 0, `quantity` = 0
|
||||
WHERE `depends_on_stock` = 1');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user