we are setting up a small online store on Magento 1.7.0.2, so far so good importing categories, attributes and products from XML and CSV files. Then I tried to implement what seemed to be an easy task to do but I can not get to my goal, here is my problem:
Suppose you have the category “Tripods” and one attribute “Weight_it_support”, meaning how much weight a particular tripod can support without falling down. Then I have another category, “Cameras” and an attribute “Weight”, no need to describe it.
Then what I want to accomplish is to have on layered navigation (or any other place) a filter with the attribute “Weight_it_support” and once I click it, show not only the tripods that supports this weight, but also the cameras with a weight less or equal than the one correspoding to the selected filter. Hope it is clear enough.
I thought that this could be accomplished by assigning the “Weight_it_support” to a set of attributes, select YES on the “Use in Layered Navigation” property of the attribute and nothing more. But these actions do not solve my goal as I need to also link the categories “Tripod” and “Camera” and this is not usefull as from this point I will have everything mixed up on those categories and we do not want that.
Any clue? Thanks!
Here is a version that creates an additional block on the “Tripods” category page when a filter regarding weight they support is active.
Repo on Github: https://github.com/herveguetin/Demo_RelatedCamera
Wiki on Github: https://github.com/herveguetin/Demo_RelatedCamera/wiki
[EDIT] GIT Repo has been updated with a version that works with full product list implementation. A block rewrite is mandatory though. It is the Mage_Catalog_Block_Product_List which is a commonly rewritten block.
[EDIT 2] Previous version was making 3 product collection loads instead of one when not mixing products from different categories (tripods + cameras). I made some updates that modify the original mySql query in order to inject statements enabling the addition of camera products. As a result, there is only one collection load even if we are requesting products from the camera category on top of the tripods.
USE WITH CAUTION : it doesn’t work when flat catalog for products is enabled. You can turn this feature on or off by setting the constant Demo_RelatedCamera_Block_Collection::USE_MYSQL_UPDATES to true of false;
On a large product base (30 000+), you are very encouraged to use this feature and scratch your head to adapt it to your needs!