I was asked to add a taxonomy attribute. I now that could be thought that it is way to broad so I'll try to do my best to lay out everything as this question evolves. The demand from them is that they don't want the categories or tags to be used for this as they are using this already. What they want is to basically have the category tree that is in the product edit page tab to be reproduced with custom data in a new tab called "taxonomies". I have bee trying to plot out how to best approach this but I'm running in circles here.

The conditions are:

  1. The values are to be searchable
  2. The existing category system is not to be replaced (in other words a solution is not "why not use the categories?")
  3. It must have hierarchy
  4. if possible have a url for the taxonomy value (yeah I know)

Basically I have just been asked to reproduce the category system. :\ I have been reading around and found many examples of setting the category tree selector in extensions, Add Category tree in custom extension for example. None of the examples are leading me to what the solution should look like.

Here are possible solutions I have been running down.

  1. A new extension that sets a EAV attribute maybe?
  2. try to copy the whole category system under a new name scope?
  3. ???

I'm not really sure where the best path is but it I know it'll be a long one.

The short of this is, how can I do what wordpress does I guess. This is where the boss people have picked up the idea and are steadfast on "this is a must".


If it's too complex, than fake the feature.

1) You could try to have a multi-select attribute. The options in admin should be padded. Padding spaces are levels to that node. Like categories in multi-select but with +1 space before childs categories. Or you can have a custom renderer in admin for that attribute which is not hard to make. On frontend you can render in layer navigation all values in a html/js tree. Values can be expandable and selectable. The values of this multiselect are searchable. If you want urls for this attribute have an extension that creates attribute_value.html pages like 'Shop by Brand' extensions. It will be a hassle to customize it for your exact needs. A variation of the attribute solution is to use a custom source table. In this table you can have a hierarchy of rows defined as you see fit.

2) A real solution would be to define a whole new module with a new EAV entity. Try to use Varien_Data_Tree. Plenty of examples in Category module. You'd not have to duplicate Category module entirely. This implementation is very complex in my opinion. It is a Magento developer nightmare - mine at least.

3) A simpler variation of 3) is to have a new entity (not EAV). Have it like the classic way of creating categories in sql tables. (parent_id, child_id) table or a column with parents of the current row. Products will be linked through an additional table with the taxonomy entity (taxonomy_id, product_id). Do use indexers and do cache most of the blocks for this taxonomy entity. Their data won't change too often.

4) I don't see customers using two trees that are in fact 2 different ways of reaching a product. The ones that don't know what to look for will have a harder time navigating in both trees. I guess you can have 2 'main' categories. One will be used in navigation and the other for 'taxonomy'. For all categories products ca be assigned. You'd have to make sure to use in navigation and layered navigation only the categories from the first 'main category'.

People that take decisions lose touch with reality now and than. Magento is a complex eCommerce platform. Merchants tend to bring their complex business logic in customers minds. Magento is a complex eCommerce platform. Implementing an extremely complex feature takes time and resources. A successful Magento store is a fast one and easy to use. If you approach this matter they'll come to their senses. Look for a different feature that addresses the main concern and that would replace the original feature (taxonomy tree).

  • For sure on #4 I agree that an end user will not be wanting to use two cat nav systems, and that will not be happening. I guess one piece of info is that the "Taxonomy" tree is so that meta data, and scheme can be made. The sad part is it's that I know #1 is a no go, they want the checkbox tree from the cat, but #3 that seems not to bad of an idea. Any thought of where a like extension may be that may server as a good example? My brain is fried today but I think that #3 seems right.
    – Quantum
    Apr 28 '14 at 23:46
  • I find all solutions valid with small variations. #1 You can have any tree html for an attribute. Just create a custom renderer for the taxonomy attribute that renders a tree with checkboxes - values are the attribute's options. #3 Sorry can't help you with an extension that implements a 'category tree like'. There is still a lot to code for a new module for #3. Take a break or switch task :) Apr 28 '14 at 23:59
  • Look, magentocommerce.com/magento-connect/clever-cms.html In each cms page define a block with parameter the values of the attribute taxonomy. Tree is taxonomy hierarchy, taxonomy is stored in a product attribute. I guess you may find straighter approaches in other extensions. Apr 29 '14 at 0:04
  • Another tree cms extension: magentocommerce.com/magento-connect/cms-tree.html Apr 29 '14 at 0:05
  • hmm the cms tree approach may not be a bad idea. I'll get it a whorl tomorrow.
    – Quantum
    Apr 29 '14 at 2:25

Basically what I understood from your question is that your need a new entity with 'tree' behavior just like categories (EAV for flat, this I didn't get), and you want that entity to be linked to products (many to many).
And you want that entity to have it's own url where you should list the products associated to it.

If that is the case then I recommend you this extension.
It does exactly that. It allows you to build your own entity (tree behaving or not, EAV or flat...your choice), link it to the products, generate SEF url's for it's instances, display the products in the entity page.

What it doesn't do...your entity is not searchable. But you can overcome this by creating a product attribute make it searchable, and when saving the product or your custom entity you can add the entity name in that field and let magento do its magic.

An other thing that doesn't do, is paginate the products in the entity view page. But this shouldn't be so hard.

Oh ...and some design changes may be needed. But all the heavy lifting it's there.

  • I have tried using your extension and was not seeing how to correctly get this done through that extension, but I'll take a look again. Thank you
    – Quantum
    May 29 '14 at 14:41
  • @jeremy.bass, Maybe I misunderstood your question and you actually CAN'T acieve what you need with that extension.
    – Marius
    May 29 '14 at 14:56
  • I may have not used it right. I do need a tree based system, I do need the urls, I do need the many to many Taxonomy to Product, so if it does that I may have not used it right. I will check unless you think that is not the case. thank you for the help
    – Quantum
    May 29 '14 at 16:06

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.