// Improve multishop API

This commit is contained in:
rMalie
2012-02-23 15:54:10 +00:00
parent 6afc517815
commit dfdce557ee
6 changed files with 13 additions and 13 deletions
@@ -81,7 +81,7 @@ class AdminCategoriesControllerCore extends AdminController
);
// if we are not in a shop context, we remove the position column
if ($this->context->shop() != Shop::CONTEXT_SHOP)
if (Shop::getContext() != Shop::CONTEXT_SHOP)
unset($this->fieldsDisplay['position']);
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected')));
@@ -98,7 +98,7 @@ class AdminCategoriesControllerCore extends AdminController
if (($id_category = Tools::getvalue('id_category')) && $this->action != 'select_delete')
$this->_category = new Category($id_category);
else
if (Shop::isFeatureActive() && $this->context->shop() == Shop::CONTEXT_SHOP)
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)
$this->_category = new Category($this->context->shop->id_category);
else if (count(Category::getCategoriesWithoutParent()) > 1)
$this->_category = Category::getTopCategory();
@@ -141,7 +141,7 @@ class AdminCategoriesControllerCore extends AdminController
$id_parent = $top_category->id;
else if ($is_multishop && $count_categories_without_parent == 1)
$id_parent = 2; //TODO need to get the ID category where category = Home
else if ($is_multishop && $count_categories_without_parent > 1 && $this->context->shop() != Shop::CONTEXT_SHOP)
else if ($is_multishop && $count_categories_without_parent > 1 && Shop::getContext() != Shop::CONTEXT_SHOP)
$id_parent = $top_category->id;
else
$id_parent = $this->context->shop->id_category;
@@ -3451,7 +3451,7 @@ class AdminProductsControllerCore extends AdminController
}
$show_quantities = true;
$shop_context = $this->context->shop();
$shop_context = Shop::getContext();
$group_shop = $this->context->shop->getGroup();
// if we are in all shops context, it's not possible to manage quantities at this level
+1 -1
View File
@@ -516,7 +516,7 @@ class AdminShopControllerCore extends AdminController
foreach ($children as $child)
$selected_cat[] = $child['id_category'];
}
if ($this->context->shop() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop'))
if (Shop::getContext() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop'))
$root_category = new Category($shop->id_category);
else
$root_category = new Category($id_root);