[-] BO: Fix #PSCFV-3711
This commit is contained in:
@@ -557,6 +557,9 @@ class AdminShopControllerCore extends AdminController
|
|||||||
*/
|
*/
|
||||||
public function processAdd()
|
public function processAdd()
|
||||||
{
|
{
|
||||||
|
if (!Tools::getValue('categoryBox'))
|
||||||
|
$this->errors[] = $this->l('You need to select at least the root category.');
|
||||||
|
|
||||||
if (Tools::isSubmit('id_category_default'))
|
if (Tools::isSubmit('id_category_default'))
|
||||||
$_POST['id_category'] = (int)Tools::getValue('id_category_default');
|
$_POST['id_category'] = (int)Tools::getValue('id_category_default');
|
||||||
/* Checking fields validity */
|
/* Checking fields validity */
|
||||||
@@ -597,9 +600,6 @@ class AdminShopControllerCore extends AdminController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// datas to import
|
|
||||||
$import_data = Tools::getValue('importData');
|
|
||||||
|
|
||||||
// specific import for stock
|
// specific import for stock
|
||||||
if (isset($import_data['stock_available']) && isset($import_data['product']) && Tools::isSubmit('useImportData'))
|
if (isset($import_data['stock_available']) && isset($import_data['product']) && Tools::isSubmit('useImportData'))
|
||||||
{
|
{
|
||||||
@@ -608,9 +608,7 @@ class AdminShopControllerCore extends AdminController
|
|||||||
StockAvailable::copyStockAvailableFromShopToShop($id_src_shop, $object->id);
|
StockAvailable::copyStockAvailableFromShopToShop($id_src_shop, $object->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we import datas from another shop, we do not update the shop categories
|
Category::updateFromShop(Tools::getValue('categoryBox'), $object->id);
|
||||||
if (!isset($import_data['category']))
|
|
||||||
Category::updateFromShop(Tools::getValue('categoryBox'), $object->id);
|
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user