Jump to content

[Solved] Browse/filter products by attributes


Recommended Posts



In this (rather long...) post I describe what my current situation is, and I'm asking which one of the three solutions is best performance and scalability wise. I REALLY appreciate any guidance because I am inexperienced with Prestashop so I have no idea which solution is best.


What I have / a description of the problem

My client sells dresses. Currently around 200 dresses, further down the line he will add accessories and such. Each dress has 5 parameters: Silhouette, waist line, neck line, length, and sleeves. Each of those parameters have like 4 to 6 values. For example there are 5 different silhouettes, 3 different waist lines, etc. A dress may actually have more than one value per parameter. For example a dress can have 2 silhouettes, 1 specific waist line, 1 neck line, etc...


I will change the categories block (in the left column) to display the 5 different parameter values, with check boxes by each value. So I will have like 25 check boxes, the user will be able to click each one and the page will display the appropriate dresses.


Implementation option 1:

Use categories. The 5 parameters will be categories, and each value will be a sub category. So Silhouette will have 4-6 different sub categories and so on.


In the URL I will pass category.php?id_category=2,3,4 for example. I've changed the CategoryController to have an array of categories and the final products list is a concatenation of the products in all categories. So the CategoryController parses the url and finds categories 2,3,4 and then the products list that is displayed is all products in (sub) categories 2, 3 and 4.


Implementation option 2:

Again I will use categories and sub categories.

This option will use the search module. The check boxes will create a string that is fed to the search module and fired. I have changed the search class to accept words separated by spaces. I'll feed the search module the name of each sub category selected separated by spaces so it'll find all the dresses in all the sub categories selected.


Implementation option 3:

This time use attributes and/or features and somehow filter by them. I have not researched this option. I have no idea how to do this.

Share this post

Link to post
Share on other sites

  • 2 weeks later...

What I ended up doing is putting each product into multiple categories, and then I changed the CategoryController to support showing more than one category. I moved the getProducts function from the Category class into the controller and re-wrote it to accept a string with multiple categories.


I then created a module that sits in the left column hook, that shows many check boxes that you can select. When you hit submit a string is built which is the IDs of the all the categories you've selected, and that is sent as the category id to the category page.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More