// BO : product form improved (categories association)
This commit is contained in:
@@ -2704,10 +2704,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
$tab_root = array('id_category' => $root->id, 'name' => $root->name);
|
||||
$helper = new Helper();
|
||||
if (Shop::getContext() != Shop::CONTEXT_SHOP)
|
||||
$category_tree = $this->l('You must select a shop if you want to put your product into a particular shop.');
|
||||
else
|
||||
$category_tree = $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true);
|
||||
$category_tree = $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true);
|
||||
$data->assign(array('default_category' => $default_category,
|
||||
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
|
||||
'selected_cat' => $selected_cat,
|
||||
|
||||
@@ -513,11 +513,13 @@ class AdminShopControllerCore extends AdminController
|
||||
return $object;
|
||||
}
|
||||
|
||||
public function initCategoriesAssociation($id_root = 1)
|
||||
public function initCategoriesAssociation($id_root = null)
|
||||
{
|
||||
if (is_null($id_root))
|
||||
$id_root = Configuration::get('PS_ROOT_CATEGORY');
|
||||
$id_shop = (int)Tools::getValue('id_shop');
|
||||
$shop = new Shop($id_shop);
|
||||
$selected_cat = Shop::getCategories($id_shop);
|
||||
$selected_cat = Shop::getCategories();
|
||||
if (empty($selected_cat))
|
||||
{
|
||||
// get first category root and preselect all these children
|
||||
|
||||
Reference in New Issue
Block a user