1

I am overriding behaviour of magento, So my question is How to display only one root category in categories tab of the new product?

I am having 5 root categories and 5th one is my navigation menu, While creating new product from backend, I wanted to display only 5th root category to choose in categories tab of new product.

1

If you check the template file /app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml, it calls the function $this->getTreeJson().

This function returns the category tree in json format, following which the category tree is built.

So, you might have to override that function(maybe pass the required root category id as its second parameter) accordingly.

2

Since Magento permissions are module based, there's no simple way to achieve this (basically you're trying to restrict access based on content).

However, there are several advanced permission extensions that could potentially help you around this Magento shortcoming.

  • No, I want make from code, I am overriding Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php, But I can't find which function returns all the categories list. – Charlie May 28 '14 at 10:52
  • @Charlie it will make sense to update your question with this info. – user487772 May 28 '14 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.