// Automatically duplicate some shop data if the primary data is checked (E.g. export carriers langs if carrier is checked) #PSCFV-2616
This commit is contained in:
@@ -797,9 +797,34 @@ class ShopCore extends ObjectModel
|
|||||||
|
|
||||||
public function copyShopData($old_id, $tables_import = false, $deleted = false)
|
public function copyShopData($old_id, $tables_import = false, $deleted = false)
|
||||||
{
|
{
|
||||||
|
// If we duplicate some specific data, automatically duplicate other data linked to the first
|
||||||
|
// E.g. if carriers are duplicated for the shop, duplicate carriers langs too
|
||||||
if (isset($tables_import['carrier']))
|
if (isset($tables_import['carrier']))
|
||||||
|
{
|
||||||
$tables_import['carrier_tax_rules_group_shop'] = true;
|
$tables_import['carrier_tax_rules_group_shop'] = true;
|
||||||
|
$tables_import['carrier_lang'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($tables_import['carrier']))
|
||||||
|
$tables_import['category_lang'] = true;
|
||||||
|
|
||||||
|
if (isset($tables_import['product']))
|
||||||
|
$tables_import['product_lang'] = true;
|
||||||
|
|
||||||
|
if (isset($tables_import['module']))
|
||||||
|
{
|
||||||
|
$tables_import['module_currency'] = true;
|
||||||
|
$tables_import['module_country'] = true;
|
||||||
|
$tables_import['module_group'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($tables_import['hook_module']))
|
||||||
|
$tables_import['hook_module_exceptions'] = true;
|
||||||
|
|
||||||
|
if (isset($tables_import['attribute_group']))
|
||||||
|
$tables_import['attribute'] = true;
|
||||||
|
|
||||||
|
// Browse and duplicate data
|
||||||
foreach (Shop::getAssoTables() as $table_name => $row)
|
foreach (Shop::getAssoTables() as $table_name => $row)
|
||||||
{
|
{
|
||||||
if ($tables_import && !isset($tables_import[$table_name]))
|
if ($tables_import && !isset($tables_import[$table_name]))
|
||||||
|
|||||||
@@ -442,8 +442,6 @@ class AdminShopControllerCore extends AdminController
|
|||||||
|
|
||||||
$import_data = array(
|
$import_data = array(
|
||||||
'carrier' => $this->l('Carriers'),
|
'carrier' => $this->l('Carriers'),
|
||||||
'carrier_lang' => $this->l('Carriers lang'),
|
|
||||||
'category_lang' => $this->l('Category lang'),
|
|
||||||
'cms' => $this->l('CMS page'),
|
'cms' => $this->l('CMS page'),
|
||||||
'contact' => $this->l('Contact'),
|
'contact' => $this->l('Contact'),
|
||||||
'country' => $this->l('Countries'),
|
'country' => $this->l('Countries'),
|
||||||
@@ -455,20 +453,14 @@ class AdminShopControllerCore extends AdminController
|
|||||||
'manufacturer' => $this->l('Manufacturers'),
|
'manufacturer' => $this->l('Manufacturers'),
|
||||||
'module' => $this->l('Modules'),
|
'module' => $this->l('Modules'),
|
||||||
'hook_module' => $this->l('Module hooks'),
|
'hook_module' => $this->l('Module hooks'),
|
||||||
'hook_module_exceptions' => $this->l('Module hook exceptions'),
|
|
||||||
'meta_lang' => $this->l('Meta'),
|
'meta_lang' => $this->l('Meta'),
|
||||||
'module_country' => $this->l('Payment module country restrictions'),
|
|
||||||
'module_group' => $this->l('Payment module customer group restrictions'),
|
|
||||||
'module_currency' => $this->l('Payment module currency restrictions'),
|
|
||||||
'product' => $this->l('Products'),
|
'product' => $this->l('Products'),
|
||||||
'product_attribute' => $this->l('Combinations'),
|
'product_attribute' => $this->l('Combinations'),
|
||||||
'product_lang' => $this->l('Products lang'),
|
|
||||||
'scene' => $this->l('Scenes'),
|
'scene' => $this->l('Scenes'),
|
||||||
'stock_available' => $this->l('Available quantities for sale'),
|
'stock_available' => $this->l('Available quantities for sale'),
|
||||||
'store' => $this->l('Stores'),
|
'store' => $this->l('Stores'),
|
||||||
'warehouse' => $this->l('Warehouse'),
|
'warehouse' => $this->l('Warehouse'),
|
||||||
'webservice_account' => $this->l('Webservice accounts'),
|
'webservice_account' => $this->l('Webservice accounts'),
|
||||||
'attribute' => $this->l('Attributes'),
|
|
||||||
'attribute_group' => $this->l('Attribute groups'),
|
'attribute_group' => $this->l('Attribute groups'),
|
||||||
'feature' => $this->l('Features'),
|
'feature' => $this->l('Features'),
|
||||||
'group' => $this->l('Customer groups'),
|
'group' => $this->l('Customer groups'),
|
||||||
|
|||||||
Reference in New Issue
Block a user