Magento multiselect attribute behavior in layered navigation - magento

I'm using the layered navigation of Magento to let the users select filters to determine their choice.
Because I have a large set of choices, I chose to use multiselect attributes so that the amount of attributes would be smaller.
The normal Magento behavior is as follows (i.e. shoes):
- User wants to find red and yellow shoes, using filter "Color"
- User selects "Red" and "Yellow" as filter options and that's it.
In my case, the selected options are depending on each other.
For instance when the user can filter on application.
- User wants to find a product that can be used in the kitchen and also in the living room.
When this user selects "Kitchen" and "Living room" as filter options and the possible products do not fit in a "bathroom", the filter option "Bathroom" has to disappear.
I've tried to do this using seperate select-attributes with only one option, but the amount of attributes keeps on growing and I'm losing overview while doing this.
How can I change the behavior of a multiselect attribute in Magento for the layered navigation, based on above example?
Thanks in advance.

If you want to change the behavior of layered navigation you need to rewrite the layered navigation in Block/Layer/.. and Model/Layer
You can use Mana Filters Modules that will allow you to have multiple filters from same type, then you can implement your own filter class for select( example price filter it has its own class in layered navigation ) etc .. !
http://www.manadev.com/advanced-layered-navigation-ce
There is also paid module amasty layered navigation

Related

Getting configurable product options pre selected from the layered navigation

I have several configurable products (with many simple products associated to them).
When browsing the super attributes through the layered navigation, you can filter down to all products that have (for instance) size= medium, Colour = Red.
I have set my simple products to not be visible and showing my configurable products, however, when you select the configurable product, the product options do not default to what has been filtered in the layered navigation.
Is there a way to get the relevant product options pre-selected on the product page?
suppose the user selected the filters from the listing page as size ="medium" colour ="red"
Now when user selects the configurable product from listing page after applying filter corresponding values must be pre selected on product detail page.
There is no ready-made way to do this. When the request is made for the product that product knows nothing of the layered navigation state. In theory you could add in some server side code to do that however this might have a performance penalty as you might not be able to use cache effectively.
You could do something on the front end in javascript. Add an event listener to the links in the filtered navigation and store an object in local storage, e.g. with size and colour.
On the product page you could then set the configurable product according to those values by waiting for the configurable product options to be built, then load the options object from local storage and then update the configurable product accordingly. You will need to then fire off events so the product page knows that options have been selected and can do things like update the price accordingly.
Internally Magento uses attribute option values that have numerical ids. These can be a bit complicated to work with, so you may want to put some logic in to read the labels instead, e.g. 'Red' instead of e.g. '461'.
There is no prototype specific way of working with local storage and you don't need some layer of jquery, normal javascript should suffice when it comes to storing/retrieving your size/colour object.
I found the following article to be the head start needed for doing things with the configurable product drop-downs:
http://inchoo.net/ecommerce/magento/how-to-make-configurable-options-autoselected-on-configurable-product-view-page/

Magento Layered Navigation Price Attribute State

I have moved my layered navigation to the toolbar and I have made all the attributes a drop downs.
My problem is with the price attribute. The state changes after you have selected a price and all the price attributes disappear (I understand with layered navigation price you can only select one by default, this is fine). My goal is to display the last selected price in the drop down after the price has been selected.
Also, I would rather modify the code then install any of the custom extensions that do this for you.
What is the best way to keep the price from disappearing or to alter the price attribute's state to not allow it to disappear?
I am able to handle the custom attributes this way: http://www.magentocommerce.com/boards/viewthread/32614/P0/
I have also looked into these posts, but they have not helped:
http://www.magentocommerce.com/boards/viewthread/41951/
Show price layered navigation after selecting price filter
Plugin Mana Filters will allow you to do what you want ,
You can use Mana Filters Modules that will allow you to have filters with different input types, and you can customize it if you need
http://www.manadev.com/advanced-layered-navigation-ce

Custom filter in Magento's layered navigation

I have a list of alpha-numeric size attributes that I need to be able to filter, either in advanced search or in layered navigation (I'm referring to Magento, if anyone else decides to remove that from the title).
the problem is that I should be able to set them as intervals. Imagine shoe sizes: 25, 25/, 31, 31/. I would like to be able to set something like:
20-25/
26-30
30/-40
With the first filter returning all shoes available in that size interval, obviously. How can I achieve this?
It occurred to me assigning thos intervals as attributes before I export them from SQL Server... Maybe that would save me some trouble...
Magento doesn't have an option to make attributes as intervals, only the price attribute is filtered like that.
I think you can do this with 2 attributes: first would be shoe size, and show this one only in the product details page, so you would list values like 25/26/27... and the second would be shoe size interval, an show this one in layered navigation/search and have values like 25-30/30-35/35-40... both of them would be dropdowns in the admin area.
You can make a module that extends Magento's default navigation, you have to rewrite filters block and model from catalog in frontend and attributes from admin so that you can add an extra option to the attribute like "interval".

Magento add custom option in the left side filter

I have products that has custom options like size, color etc. All are unique to the products and not shared by attributes. How can i add these filters on the product listing pages. I hope i write my question clearly. Please let me know if you want more information. Thanks for your help.
In Magento, two properties will appear as layered navigation filters without you having to do anything: Price and Categories
Its better to store them as attributes and make them filterable , then it will be displayed in the layered navigation.
You can see here how layered navigation works.
And if you want to know how to include this layered navigation widget in any of the page, read this tutorial

Magento - layered nav - display attribute based on previous filter

Basically, what I would like to do is have some attributes in the layered nav block show up only if a particular filter was set before. Here’s an example:
Customer goes into ‘rings’ category. There would be many different attributes displayed in the ‘shop by’ block, however I only want a few to be shown at this stage including: Material (white gold, yellow gold, silver etc.). If, and only if, the customer selected a material (specifically yellow or white gold), on the next page i would like there to be the ‘gold carat’ attribute available in this block. As it is at the moment ‘material’ and ‘gold carat’ are both shown in the layered nav which isn’t ideal.
Ive had a look at the code in app/design/frontend/default/default/template/catalog/layer but I can’t seem to get any inspiration.
Thanks for any help
Jamie
Jamie - Unfortunately, as I'm sure you have discovered, Magento doesn't do this out-of-the-box. The layered navigation is built based upon the available attributes (that have been set as filterable nav) for the category listing you are viewing.
You would have to write a custom module to override the layered nav output. A place to start could be /app/code/core/Mage/Catalog/Block/Layer/Navigation.php. Good luck!

Resources