PrestaShop Forums: Filters/Layered Navigation/Advanced Search Module HOWTO - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Filters/Layered Navigation/Advanced Search Module HOWTO


Filters/Layered Navigation/Advanced Search Module HOWTO

#1 EnigmaPsi

    PrestaShop Newbie

  • 24 Nov 2008
  • Members
  • Pip
  • 8 posts
  • Location:Romania

Posted 10 December 2008 - 06:40 PM

I have seen a lot of topics on the forum about this basic capability that Prestashop lacks, and I decided it could be a good idea I write a module for this, until the dev team decides to build the func into the core, maybe, or come with it's own module. The only problem is that I can't seem to find a module HowTo.

What should this module do?

It should allow filtering products based on owner-specified criteria (this is, only display the products that match, not sort them). See Magento Layered Navigation. This criteria should be defined on a per-category basis. Moreover, products in any category should be able to be filtered by manufacturer.

E.g.: We have a "Laptops" category. When we click on it, we see all the laptops our shop has, and can sort them (at this time) based on different criteria: price, name (A-Z), etc. Well, if we have, let's say, 200 laptop models, no one will browse pages to find one that's in the middle of the list.

So, the first step in the shopper filtering process would be to select a manufacturer. This filter could be invariable (i.e. category-independent, hardcoded).

Next, we will select a processor type, a monitor width and so one. These parameters should be defined in the backoffice, based on existing attributes and be category-dependent. Another type of filter should be a price-range, also category-based and also defined in the backoffice.

In the front-office, a set of SELECT boxes should appear somewhere (e.g. near "sort by" box), having a label named after the attribute name (e.g. "Manufacturer", "Processor type") and values - the DISTINCT values in the DB for that attribute ("Manufacturer" should contain all distinct manufacturers in that category). Of course, the presentation could be different (for example a left-block), but you get the idea.

When selecting any of those values, we should see only the products that match, in that category (and the value should remain selected in the box). Also, the filters have to be cumulative.

Appearance

Back office: each category (and subcategory) should have options to configure filter attributes and a price-range (add, edit, delete).

Front office: the filters should be placed somewhere on the page (left block, near "sort by" field, etc.)

-----------------------------------------------

This is not a feature request. I'm interested in programming this module, but I need some guidelines for that:
1. Where to hoook this module ("Extra action on the product page" - is it a good position?)
2. What DB tables are involved
3. Any other interesting info.


If any developer or PS guru out there could provide any information, I'm glad to hear it, and thanks in advance.

If this capability is being implemented right now (this is, you work on it, not planning), just let me know. This is the only and only missing (basic) feature that stops my company to swith to prestashop from ZenCart. And it's not only our case.

Thank you.

#2 PShopExpert

    PrestaShop Addict

  • 07 Dec 2008
  • Members
  • PipPipPip
  • 663 posts
  • Location:France

Posted 10 December 2008 - 07:24 PM

Good idea!

In the backoffice: filter attributes can be defined by selecting which caracteristics will be used (just a checkbox list in "configure" of a module) and the price range may be set dynamically in the block by the user, no need to edit these values for each category.

So you just need to create a module and not change anything in the backoffice or use a specific hook.
For me the place of this module should be just at the below the categories block in the left column.
Essayez Store Commander pour Prestashop et disposez enfin de vos week-ends !
Want spare time, lovely week-ends? Then request a demo of Store Commander for Prestashop!

#3 AnimeCYC

    PrestaShop Apprentice

  • 29 Jul 2008
  • Members
  • PipPip
  • 82 posts

Posted 10 December 2008 - 08:30 PM

That is a great idea,

This should be placed on either the left or right columns and not on the product page. You can easily get the tables used by looking at product.php that should be a great start for you. Also it would be better to not anyone set the filter ranges but rather set which filter ranges will appear. I would also suggest to not use the features and attributes that come stock with PrestaShop as they will only cause you problems, I would write a module that aggregates the data already present and places it into a new database and from there, if the module is activated, inserts new data into the newly created tables. This will make it much easier as the data you need will only be stored in one or two databases instead of across 5 or 6. That is just my two cents, Good Luck!

- Seth

#4 EnigmaPsi

    PrestaShop Newbie

  • 24 Nov 2008
  • Members
  • Pip
  • 8 posts
  • Location:Romania

Posted 10 December 2008 - 09:13 PM

From 1228933477:

Good idea!

In the backoffice: filter attributes can be defined by selecting which caracteristics will be used (just a checkbox list in "configure" of a module) and the price range may be set dynamically in the block by the user, no need to edit these values for each category.

So you just need to create a module and not change anything in the backoffice or use a specific hook.
For me the place of this module should be just at the below the categories block in the left column.


Well, configuring this in the module configuration doesn't seem such a good idea to me. The filters should be category-specific, not sitewide. A short example: for "Laptops" category we can filter after RAM size, but this is irrelevant for "Monitors" category. If we configure filters in the module "configure", RAM size will appear regardless of category (this is, for any product). At least this is what I understood from your approach, please correct me if I miss anything.

From 1228937430:

This should be placed on either the left or right columns and not on the product page. I would also suggest to not use the features and attributes that come stock with PrestaShop as they will only cause you problems, I would write a module that aggregates the data already present and places it into a new database and from there, if the module is activated, inserts new data into the newly created tables. This will make it much easier as the data you need will only be stored in one or two databases instead of across 5 or 6.


I suppose that by "databases" you meant tables. It is a good suggestion, but new problems would arise: aggregated data should be updated every time a product is added, and doing this means I should also alter "add product" function(s). After all, making a new table from 5 or 6 is not such a difficult task (powered by JOIN :) ).

Also, the location of this widget is not a primary concern, as far as I could see, a block can be placed anywhere on the page (left, right, etc.). This should be configurable (native, if the module is written correctly). I would place it on the product page because it is category-specific but, again, this is not mandatory.

Thank you for your answers.

#5 AnimeCYC

    PrestaShop Apprentice

  • 29 Jul 2008
  • Members
  • PipPip
  • 82 posts

Posted 10 December 2008 - 09:23 PM

Depending on the server environment JOIN can be slow and very daunting ;) but you have a point pretty much 90% of Presta is using JOIN xD as far as configuration your right about that but why would you have a layered search on a product page, I thought the idea of a search was to actually find the item -- not search for it after you've already landed on it xD Anyhow best of luck, I was planning on doing this but you beat me to it ;)

- Seth

#6 ejectcore

    PrestaShop Addict

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 10 December 2008 - 09:38 PM

This is a module we have developed for Linksphere one of our clients please feel free to chat about this with us SKYPE: amwdesign


class FiltersPanel extends Module
{
function __construct()
{
$this->name = 'filterspanel';
$this->tab = 'Panels';
$this->version = 0.1;


Also currently working on many other new modules including advanced searches & search by price categories etc.

We would like to release all these modules to the community, but have one major project which has to come 1st However as planned & extremely late the CMS Pro update for Prestashop will be released before the new year.
allowing you to control content anywhere :)

Unfortunately at this stage we will no be requiring any beta testers, it seemed much simpler for compatibility issues to update the existing CMS module for Prestashop.
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#7 EnigmaPsi

    PrestaShop Newbie

  • 24 Nov 2008
  • Members
  • Pip
  • 8 posts
  • Location:Romania

Posted 10 December 2008 - 09:42 PM

From 1228940604:

why would you have a layered search on a product page, I thought the idea of a search was to actually find the item -- not search for it after you've already landed on it ;)


Indeed, you don't need to search for an item in a category with, let's say, 10 items. But when you have, for example, 100 types of items (we have this on our shop - over 100 UPS-es and UPS related products), no one will look for it by reading the specs, they would rather filter this big result. For the moment, because the lack of this feature, Prestashop is suited to shops with categories with not very many products (I would say 10, maybe 15 is a maximum a potential buyer will tolerate without filters).

#8 AnimeCYC

    PrestaShop Apprentice

  • 29 Jul 2008
  • Members
  • PipPip
  • 82 posts

Posted 10 December 2008 - 09:45 PM

Haha,

I think you missed what just happened xD I thought you said you wanted it on the product page not the category pages, the category page is much more understandable then searching for an item only on the page were you view a product. lol there was a misunderstanding somewhere xD

- Seth

#9 EnigmaPsi

    PrestaShop Newbie

  • 24 Nov 2008
  • Members
  • Pip
  • 8 posts
  • Location:Romania

Posted 10 December 2008 - 11:04 PM

Thanks for your invitation, mr. amwdesign. I enterd skype quite late, and seemed you logged out by then. Maybe tomorrow...

#10 ejectcore

    PrestaShop Addict

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 10 December 2008 - 11:46 PM

still here :)
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#11 PShopExpert

    PrestaShop Addict

  • 07 Dec 2008
  • Members
  • PipPipPip
  • 663 posts
  • Location:France

Posted 11 December 2008 - 11:04 AM

From 1228940022:

From 1228933477:

Good idea!

In the backoffice: filter attributes can be defined by selecting which caracteristics will be used (just a checkbox list in "configure" of a module) and the price range may be set dynamically in the block by the user, no need to edit these values for each category.

So you just need to create a module and not change anything in the backoffice or use a specific hook.
For me the place of this module should be just at the below the categories block in the left column.


Well, configuring this in the module configuration doesn't seem such a good idea to me. The filters should be category-specific, not sitewide. A short example: for "Laptops" category we can filter after RAM size, but this is irrelevant for "Monitors" category. If we configure filters in the module "configure", RAM size will appear regardless of category (this is, for any product). At least this is what I understood from your approach, please correct me if I miss anything.


In fact I thought you can get caracteristics used (not null) in a category by products to simplify but finally the search tool requires more precisions to select criterias.
Essayez Store Commander pour Prestashop et disposez enfin de vos week-ends !
Want spare time, lovely week-ends? Then request a demo of Store Commander for Prestashop!

#12 godslayer

    PrestaShop Newbie

  • 11 Dec 2008
  • Members
  • Pip
  • 12 posts

Posted 11 December 2008 - 11:53 AM

Hi all, I have checked Linksphere and I found out that the layered navigation was not complete. You can only navigate once...
For example, when you enter a certain category, say CPU, then you filter by brand or something, afte that, you can not continue filtering by other attributes like price, color...
So this layered navigation still need someone to finish it thoroughly.

BTW, Prestashop has better customer experience than Magento. Keep going! Your fondation is solid for Prestashop is loaded as fast as lightning! Plus: it is easy to find a hosting!

#13 ejectcore

    PrestaShop Addict

  • 08 Apr 2008
  • Members
  • PipPipPip
  • 827 posts
  • Location:UK

Posted 11 December 2008 - 01:12 PM

All you would need to do is create an additional id_parent then have as many levels as you require.
The reason we didn't do this with Linksphere is because there are nearly 6500 products being updated daily.
Although currently creating a batch update in the backoffice this would be far too much work for my client at this stage.
However in the future this will be considered. Again I can support this feel free to chat with me on SKYPE ;)
Filter Search 2.1 Enterprise Edition Now Available

Available Soon
Filter Search 2.1 Lite Edition

Follow us on twitter

#14 godslayer

    PrestaShop Newbie

  • 11 Dec 2008
  • Members
  • Pip
  • 12 posts

Posted 11 December 2008 - 02:11 PM

I think this layered navigation behavior can be automated based on several criterias or attributes. The current available layer(s) will be created automatically baesd on the current set of products until there is only one pure set of products.

Does it need to code in the core of Prestashop or this can be achieved by making a module?

I think it is time to consider making up some necessary features for Prestashop that stops people from using this wonderful eCommerce platform!

#15 Joël Gaujard

    PrestaShop Addict

  • 06 Nov 2007
  • Members
  • PipPipPip
  • 718 posts
  • Location:Nice, France

Posted 05 March 2009 - 04:56 PM

Hi EnigmaPsi,
I created a module called "products filter" whose can certainly match with a part of yours needs. It filters products list by price range / by manufacturer on page category / by category on manufacturer page.
You can see it here: http://prestashop.jo...p?id_product=14
Perhaps we can work together for ameliorate this module...
Previously developer at | Ancien développeur chez PrestaShop
Ingénieur/webdeveloper freelance
Visit PrestaPlayers

#16 ydavid

    PrestaShop Newbie

  • 17 Mar 2009
  • Members
  • Pip
  • 13 posts

Posted 13 April 2009 - 04:07 PM

Adam at amwdesign and I have been working together the past 3 weeks to develop a high-end filtered navigation module. We are almost finished with a 1.0 version of the module, and we are looking for sponsors to contribute $100-200 each towards continued development. We will be creating a roadmap soon to detail our development plans, but please let us know asap if you are interested.

SKYPE: yaakov.david
SKYPE: amwdesign
Filter Search Pro Now Available!
Advanced Filtered Navigation Module for Prestashop
available at our website: http://ejectcore.com
FREE limited community release coming soon

Currently looking for sponsors for our CMS Pro module that adds advanced CMS features to Prestashop.

Checkout Pro releasing xmas 2009
Attributes Management Pro T.B.A.

Contact us via SKYPE for further details
amwdesign
yaakov.david

And follow our updates on twitter at http://twitter.com/ejectcore

#17 Joël Gaujard

    PrestaShop Addict

  • 06 Nov 2007
  • Members
  • PipPipPip
  • 718 posts
  • Location:Nice, France

Posted 15 April 2009 - 11:26 AM

Hi to all,
And what do you think about my module ?
Previously developer at | Ancien développeur chez PrestaShop
Ingénieur/webdeveloper freelance
Visit PrestaPlayers

#18 cagrie

    PrestaShop Apprentice

  • 12 Apr 2009
  • Members
  • PipPip
  • 132 posts

Posted 19 April 2009 - 07:52 AM

any updates on this topic? I just thought of doing the same myself last night, and all of a sudden I saw this topic.

has anyone accomplished this? any demos?

ty

#19 Presta-TR

    PrestaShop Addict

  • 12 Nov 2008
  • Members
  • PipPipPip
  • 544 posts

Posted 19 April 2009 - 12:18 PM

yes too needs that modification/module..

waitss

#20 Joël Gaujard

    PrestaShop Addict

  • 06 Nov 2007
  • Members
  • PipPipPip
  • 718 posts
  • Location:Nice, France

Posted 20 April 2009 - 06:12 AM

Hello cagrie,

You can see a demo of my module on this website : http://www.empire-sono.com/

Regards
Previously developer at | Ancien développeur chez PrestaShop
Ingénieur/webdeveloper freelance
Visit PrestaPlayers





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users