Filter Products by AND instead of OR

Posted by Community Admin on 05-Aug-2018 19:27

Filter Products by AND instead of OR

All Replies

Posted by Community Admin on 04-Apr-2013 00:00

I'd like to display products that have both TAG1 and TAG2.  It seems like if I select TAG1 and TAG2, I get all products that have TAG1 and all products that have TAG2 .  ( want only products that have BOTH)

Is there a way to change the behavior to "narrow" the list?  It's not a pure hierarchy, so I need to use tags (not categories)

Any suggestions ?

thanks
Tim

Posted by Community Admin on 09-Apr-2013 00:00

Hello Tim,

Currently there is no setting to change the behavior of the FilterProducts widget in this way. I have submitted a feature request in PITS which you can vote for here.

Kind regards,
Randy Hodge
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 10-Apr-2013 00:00

Can you provide any direction (or example!)  in how I might implement it myself ?

thanks much
-Tim

Posted by Community Admin on 12-Apr-2013 00:00

Hello Tim,

You could create your own TagFilterUrlEvaluator and TagFilterDynamicQueryBuilder classes and modify them to your needs. I have attached the default classes for you to get started.

Then in the DataConfig.config file, modify the highlighted text in this line:

<add description="TagFilterEvaluatorDescription" resourceClassId="CatalogResources" type="Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UrlEvaluators.TagFilterUrlEvaluator" enabled="True" name="TagFilter" />
to your new class.

This has never been tested so please let us know how it turns out.

All the best,
Randy Hodge
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-Apr-2013 00:00

Thanks much!  I'll give it a whirl !

Posted by Community Admin on 29-Apr-2013 00:00

Hi Randy, I'm trying to create my own filter per your instructions and having some trouble....
-----SNIP---- 
namespace Telerik.Sitefinity.Modules.Ecommerce.Catalog.Implementations.ShopByFilter.QueryBuilders

    internal class CustomTagFilterDynamicQueryBuilder : IShopByFilterQueryBuilder
   
ENDSNIP-------
Error 3 'Telerik.Sitefinity.Modules.Ecommerce.Catalog.Interfaces.ShopByFilter.QueryBuilder.IShopByFilterQueryBuilder' is inaccessible due to its protection level 

Does that mean I need the IShopByFilterQueryBuilder class as well?

-Thanks
tim

Posted by Community Admin on 01-May-2013 00:00

Hello Tim,

IShopByFilterQueryBuilder is an interface, not a class. You should be able to not use it. I don't see any place where the TagFilterDynamicQueryBuilder class is being instantiated as IShopByFilterQueryBuilder.

So try not implementing the IShopByFilterQueryBuilder interface in your custom class.

I hope that helps.

All the best,
Randy Hodge
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 05-Sep-2013 00:00

Hi Randy,
is it possible to have default 'OR' behavior for most of Classificaitons except some where I need 'AND'?

For example I have classificaiton "Device type" with values: Phone, Sim card, Internet device...
and classification "Features" with values: Wi-fi, HD Screen, Front camera, HD Video....

I need to filter with 'OR' by Device type
and filter with 'AND' by Features

Is it possible? How can I do it? From your answer it looks like all filters will be replaced?

Thanks,
Alex
software developer

Posted by Community Admin on 09-Sep-2013 00:00

Hi Alex,

 For a complex solution such as this is may be better to create your own widget(s). The implementation at this point is a little black and white.  You can have one but not both at the same time down to specific tag types or situations.

Regards,
Patrick Dunn
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 24-Nov-2015 00:00

[quote]Alex said:Hi Randy,
is it possible to have default 'OR' behavior for most of Classificaitons except some where I need 'AND'?

For example I have classificaiton "Device type" with values: Phone, Sim card, Internet device...
and classification "Features" with values: Wi-fi, HD Screen, Front camera, HD Video....

I need to filter with 'OR' by Device type
and filter with 'AND' by Features

Is it possible? How can I do it? From your answer it looks like all filters will be replaced?

Thanks,
Alex
software developer[/quote]

Hi Alex,

Have you managed to find the solution? I have a similar problem and I would be happy if you share your experience.

Thanks

This thread is closed