0

I am working on Magento 1.9 and stuck on some problem my problem is that I want to add single category to multiple parent categories like the example

parent-category1

  • sub category1

parent-category2

  • sub category1

i have read many forum and article on this problem but couldn't find the solution for this problem so any one can help me in this problem. if you have any extension to solve this problem then please specify me the name of that plugin or extension

1

Out of the box is not possible.
The category entity behaves as a tree. What you need here is to make it behave as a graph.
In theory you can display a subcategory as a child of 2 categories but I think it involves a lot of work.
The place to start is Mage_Catalog_Model_Observer::_addCategoriesToMenu.
That's the method that adds the categories to the main menu.
You should find a way to associate a subcategory to multiple parent categories (a multiselect attribute with all the parent categories in the child category, or all the lower level categories in the parent category is the way I would go) and then check the value that attribute in the method mentioned above and insert child nodes accordingly.
But this has a drawback.
When you click on subcategory1 from inside parent-category2 the url will still be parent-category1/subcategory1.
If you want clean url rewrites you have to change the url rewrite generation mechanism and that's not that easy.

1

I recommend to no do this. You get in a lot of trouble, when you build a graph out of a tree, because you change the whole structure.

Instead just create a second category with the same name and put all the products into this.

Why do you want to do this?

  • yes you are write but i if i will go through the traditional way then i have to add a huge number of duplicate categories and it is very time consuming so do you have any other way to do this. – user3872651 Aug 23 '14 at 10:28
  • 1
    Automate what you want to achieve. – Fabian Blechschmidt Aug 24 '14 at 9:24

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.