[-] BO: Fix root category should anyway be imported in shop creation #PSCFV-5885
This commit is contained in:
1 parent
a8096c2800
commit
e8718ec42f
3 files changed
+19
-8
No files matched your search
@@ -119,10 +119,16 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('input[name=useImportData]').click(function() {
|
$('input[name=useImportData]').click(function() {
|
||||||
if ($(this).attr('id') == 'useImportData_on')
|
if ($(this).attr('id') == 'useImportData_on')
|
||||||
$('#shop_list, #data_list').slideDown('slow');
|
{
|
||||||
else
|
$('input[name^="importData["]').prop('checked', true);
|
||||||
$('#shop_list, #data_list').slideUp('slow');
|
$('#shop_list, #data_list').slideDown('slow');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('input[name^="importData["]').prop('checked', false);
|
||||||
|
$('#shop_list, #data_list').slideUp('slow');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#id_category, #importFromShop').change(function(){
|
$('#id_category, #importFromShop').change(function(){
|
||||||
shop_id = $('#importFromShop').val();
|
shop_id = $('#importFromShop').val();
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class ShopCore extends ObjectModel
|
|||||||
'supplier' => array('type' => 'shop'),
|
'supplier' => array('type' => 'shop'),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach($asso_tables as $table_name => $table_details)
|
foreach ($asso_tables as $table_name => $table_details)
|
||||||
Shop::addTableAssociation($table_name, $table_details);
|
Shop::addTableAssociation($table_name, $table_details);
|
||||||
|
|
||||||
Shop::$initialized = true;
|
Shop::$initialized = true;
|
||||||
@@ -975,6 +975,10 @@ class ShopCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
// If we duplicate some specific data, automatically duplicate other data linked to the first
|
// 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
|
// E.g. if carriers are duplicated for the shop, duplicate carriers langs too
|
||||||
|
|
||||||
|
if (!$old_id)
|
||||||
|
$old_id = Configuration::get('PS_SHOP_DEFAULT');
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -265,9 +265,10 @@ class AdminShopControllerCore extends AdminController
|
|||||||
|
|
||||||
protected function afterAdd($new_shop)
|
protected function afterAdd($new_shop)
|
||||||
{
|
{
|
||||||
$import_data = Tools::getValue('importData');
|
$import_data = Tools::getValue('importData', array());
|
||||||
if (Tools::getValue('useImportData') && is_array($import_data))
|
|
||||||
$new_shop->copyShopData((int)Tools::getValue('importFromShop'), $import_data);
|
// The root category should be at least imported
|
||||||
|
$new_shop->copyShopData((int)Tools::getValue('importFromShop'), $import_data);
|
||||||
|
|
||||||
// copy default data
|
// copy default data
|
||||||
if (!Tools::getValue('useImportData') || (is_array($import_data) && !isset($import_data['group'])))
|
if (!Tools::getValue('useImportData') || (is_array($import_data) && !isset($import_data['group'])))
|
||||||
|
|||||||
Reference in new issue
Block a user