[-] BO: Fix various bugs in categories ntree generation

This commit is contained in:
Rémi Gaillard
2012-12-11 11:19:21 +01:00
parent ecac947c2e
commit b2f01058a8
4 changed files with 10 additions and 10 deletions
@@ -177,7 +177,7 @@ class AdminCategoriesControllerCore extends AdminController
$categories_tree = $this->_category->getParentsCategories();
if (empty($categories_tree)
&& ($this->_category->id_category != 1 || Tools::isSubmit('id_category'))
&& ($this->_category->id != 1 || Tools::isSubmit('id_category'))
&& (Shop::getContext() == Shop::CONTEXT_SHOP && !$is_multishop && $count_categories_without_parent > 1))
$categories_tree = array(array('name' => $this->_category->name[$this->context->language->id]));
@@ -322,7 +322,7 @@ class AdminCategoriesControllerCore extends AdminController
$guest_group_information = sprintf($this->l('%s - Customer who placed an order with the Guest Checkout.'), '<b>'.$guest->name[$this->context->language->id].'</b>');
$default_group_information = sprintf($this->l('%s - All people who have created an account on this site.'), '<b>'.$default->name[$this->context->language->id].'</b>');
$root_category = Category::getRootCategory();
$root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name);
$root_category = array('id_category' => $root_category->id, 'name' => $root_category->name);
$this->fields_form = array(
'tinymce' => true,
'legend' => array(
+2 -2
View File
@@ -196,7 +196,7 @@ class AdminShopControllerCore extends AdminController
{
$root_category = new Category((int)Tools::getValue('id_category'));
$root_category = array(
'id_category' => $root_category->id_category,
'id_category' => $root_category->id,
'name' => $root_category->name[$this->context->language->id]
);
$selected_cat = array($root_category['id_category']);
@@ -629,7 +629,7 @@ class AdminShopControllerCore extends AdminController
$selected_cat[] = $root_categories[0]['id_category'];
foreach ($children as $child)
$selected_cat[] = $child->id_category;
$selected_cat[] = $child->id;
}
if (Shop::getContext() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop'))
$root_category = new Category($shop->id_category);