+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / Filter Products by AND instead of OR

Filter Products by AND instead of OR

10 posts, 0 answered
  1. Tim
    Tim  avatar
    34 posts
    Registered:
    16 Oct 2012
    04 Apr 2013
    Link to this post
    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
  2. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    09 Apr 2013
    Link to this post
    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
  3. Tim
    Tim  avatar
    34 posts
    Registered:
    16 Oct 2012
    10 Apr 2013 in reply to Randy Hodge
    Link to this post
    Can you provide any direction (or example!)  in how I might implement it myself ?

    thanks much
    -Tim
  4. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    12 Apr 2013
    Link to this post
    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
  5. Tim
    Tim  avatar
    34 posts
    Registered:
    16 Oct 2012
    13 Apr 2013 in reply to Randy Hodge
    Link to this post
    Thanks much!  I'll give it a whirl !
  6. Tim
    Tim  avatar
    34 posts
    Registered:
    16 Oct 2012
    29 Apr 2013 in reply to Randy Hodge
    Link to this post
    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
  7. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    01 May 2013
    Link to this post
    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
  8. Alex
    Alex avatar
    2 posts
    Registered:
    29 Jul 2013
    05 Sep 2013 in reply to Randy Hodge
    Link to this post
    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
  9. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    09 Sep 2013
    Link to this post
    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
  10. Igor
    Igor avatar
    39 posts
    Registered:
    17 Jul 2012
    24 Nov 2015 in reply to Alex
    Link to this post

    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

    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

10 posts, 0 answered