Merge pull request #694 from sjousse/patch-1
[*] MO : ShopImporter module is now aware of multi-shop for categories
This commit is contained in:
commit
d59f3383cf
1 file changed
+11
-1
@@ -959,7 +959,17 @@ class shopimporter extends ImportModule
|
|||||||
c.id_parent = c2.`id_category_'.bqSQL($moduleName).'`
|
c.id_parent = c2.`id_category_'.bqSQL($moduleName).'`
|
||||||
SET
|
SET
|
||||||
c.id_parent = c2.id_category
|
c.id_parent = c2.id_category
|
||||||
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0');
|
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0
|
||||||
|
AND c.`id_parent` != 0');
|
||||||
|
|
||||||
|
// get first PS home category's id
|
||||||
|
$home_categories = Category::getRootCategories();
|
||||||
|
$home_category_id = $home_categories[0]['id_category'];
|
||||||
|
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'category c
|
||||||
|
SET c.id_parent = '.$home_category_id.'
|
||||||
|
WHERE c.`id_category_'.bqSQL($moduleName).'` != 0
|
||||||
|
AND c.`id_parent` = 0');
|
||||||
|
|
||||||
$category = new Category();
|
$category = new Category();
|
||||||
$cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT'));
|
$cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||||
foreach($cats as $cat)
|
foreach($cats as $cat)
|
||||||
|
|||||||
Reference in new issue
Block a user