Developer forum

Forum » Ecommerce - Standard features » Facets for product subgroups

Facets for product subgroups

Tomas Gomez
Reply

Hi,

I want to create a facet for the product subgroups of a selected group. For example, in Rapido, when user selects the "Products > Bikes" menu, the facet must show: Mountain bikes, Road bikes, etc.  In the facet documentation, an image is shown with this facet, but no related information is given :(

A facet field with "Query parameter = GroupID" shows all the groups. An alternative would be to create list facets for each primary group, setting them as cascade facets to be shown/hide only when its primary group is selected, but it would be better an automatic strategy.

Which is the best approach to do this kind of facet?

Regards,
Tomás

Subgroups-facet.png

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

When you are in Bikes, use a cascading facet on the "ParentGroupNames" field. Create some custom rendering of the facet and remove everything where count = 0. This would give you more or less that. Except if a product is member of 2 groups.

Basically you should not use a facet for that - but a navigation that renderes the sub groups of the current group - and then make it look like it was a facet.

BR Nicolai

Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Tomas,

 

I'd beware of the desired UX. I've been chasing this for a few years with different customers and it boils down to how that works with the other facets. Common issues are:

  • Using Navigation to look like Facets
    • Let's assume your in page 2 of results with 2 or 3 facets selected
    • User cliks on a "subgroup" what happens?
      • Do you honor all of the URL parameters? You need to "remember" the filter selection
      • But you really go back to page 1
      • And since it's navigation, you don't really have the #results
  • Using Facets (like Nicolai suggested)
    • Let's assume Products can belong to multiple groups and the facet is specifically named
      • The facet options may not be related to the "parent group name"
      • Because facets don't have a tree hirarchy, you may be getting 2nd level and 3rd level groups mixed into one

We've been trying to use a new approach recently through an IndexBuilderExtender, where we create new fields specifically for LevelOneGroupID (and Name), LevelTwoGroupID until level 5. This gives us some awareness of the depth level, so we only present 2nd level groups as facet options, but if a product belongs to multiple 2nd level groups, you get presented with that.

 

A next level approach you also do is to take the IndexBuilderExtender approach (or the Facets approach - 2nd bullet), and then generate a custom facet helper that cross-checks with navigation items. While you're getting valid 2nd level facet options (which also give you number of results, and by being facets you overcome issues with determining urls), you can remove the facet options (groupID) that don't exist under a particular group (active ecom group navigation).

But this approach may have some more performance issues and be extra challenging getting entire group navigation and/or using API vs XSLT vs other options you find to get the proper context navigation.

 

Hope that makes sense.

 

Best Regards,

Nuno Aguiar

Votes for this answer: 1
 
Tomas Gomez
Reply

Hi, thanks for your suggestions!

Considering the caveats pointed by Nuno, I opted for a non-adaptative solution because it was simplier to implement (and the structure of our product groups is fixed).

The method has been:

  • Create a new field "Subgroup" inside the category field of the main groups. This "Subgroup" field is a listbox of all the subgroups, i.e. the secondary groups.
  • Edit each subgroup to set the "Subgroup" field to its own subgroup option. This way, all the products inside MySubgroupX have "Subgroup = MySubgroupX"
  • In the query, add a new "Subgroup" parameter (Type=String[]), and a expression to match the parameter with the attribute.
  • Create a new cascading facet to display the subgroups. with Query parameter = "GroupID" and Value = "MAINGROUP1,MAINGROUP2,MAINGROUP3..." to show the facet only when the main groups are selected.

The disadvantage of this method is that it can be out of adjustment (between the groups and the facets) but, at the other hand, it is easy to implement and to fix any error.

Regards,
Tomás

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Tomas,

 

Yeah, we also haven't found a great easilly repeatable way. That are pros and cons and customers and non-tech people sometimes have trouble understanding them until after the experience it for the first time.

 

I particularly love it when they point out to Site A and Site B (both with opposite approaches) saying "They can do it", without looking for the caveats.

 

Nuno

 

You must be logged in to post in the forum