Developer forum

Forum » Ecommerce - Standard features » Facet option count goes to 0

Facet option count goes to 0

Peter Leleulya
Peter Leleulya
Reply

Hi guys,

I have facets on my product list page of type checkbox.
By default the count of each option is shown behind the label.

When I select 1 checkbox in a group and the page has refreshed the other option counts go to 0 within that group.
My client wants the origional quantity to be shown.

I noticed in my test setup of swift (with downloaded db) that the count does NOT go to 0 there.
But I can't find out why ...
Does anyone have an idea?

I'm not sure how the swift filters should work, but I think they don't filter as they should.
For example, when I go to the mountain bikes list page and ONLY filter for size M the result shows bikes with size S and XL which don't have an M variant.

When yu see the image below and I compare it to my application (9.12.4), all 6es but not the checked ones go to 0.
Which is the correct number for the amount of occurrences in the result.
And the facet option has no property for the origional value.



Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Peter,

 

The reason why "Size" does NOT go to 0, it's because it's getting only master/main products (isVariant = false), and those lucene documents contain the info about all of their variant options. In fact I happen to think this is misleading, but that's my personal point of view.

 

What you experience of facets values goints to 0, is actually the expected behavior, because facet options are based on the distinct values of the results (not the entire catalog).

 

If you really need to have all possible facet options amounts, even if the search results is only 1 product, that will be tricky, as you likely have to custom develop to get facets for a particular query (with no filters, so you have the all numbers based on whatever selection you want, like Group ID), and then another one to get the actual list of product results (and paging and whatnot).

 

Does that help explain it?

Nuno Aguiar

 
Peter Leleulya
Peter Leleulya
Reply

Thanks Nuno,

This does explain it and actually confirms our own thoughts on this matter.
The issue is that the customer want's it to behave like the leading Dutch webshops, which do still show the total option amount when a sister option is selected.
We have been discussing to do another call and then update the 0 values, but that feels a bit iffy as a solution to the problem/feature.
We have been trying to use the dwapi/docs calls but weren't able to just get the facet values.

I probably have to do a feature request on this, but not sure how dw will be able to do those counts, as the values do not exist in the current index query result.
It is a bt of a challenge.
If anyone has an idea or has attempted this before. please share your thoughts,

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Peter,

 

I have an idea:

  • For the product list to filter, sort and page, you can't change anything about the querystring. Leave it as is.
  • Create a new custom Facets Paragraph/Column that makes an ajax request to the a "feed page" (or the dwapi - but I don't know how you'd do that to just get a particular group of facets)
    • Considering the Rapido approach - it's just a request to that page with no querystring parameters
    • That would give you all of the possible facets, options and counts for the entire catalog
    • Then when consuming the response, you'd populate the necessary checkboxes from the page request

 

 

 

If you'd then get a solution to using the dwapi, you could just replace the path for that request and delete the "feed page", but that should allow you to get started.

 

As for it being a feature request, it would not be that simple, because whereas your project may want all possible facets for the entire catalog, the next project may want based on toplevel ecom group and/or another parameter. Come to think of it, you could add an Editable list of querystring parameters to add to the querystring of the ajax request (should they exist in the request).


The option presented above allows for that, in which case, you can determine in the ajax request, which querystring parameters to submit. In any case, specially if you can get it to work with the dwapi, it should be simple to reuse for your next project.

 

Best Regards,

Nuno Aguiar

 
Nicolai Pedersen
Reply

This should work as you explain.

You have raised the issue with variants not showing up on another thread, and I think that is the same issue.

If you take a look at the Swift demo - it does not change the count in each facet group:

https://dwswiftdemo.acc10.innovadis.com/bikes

BR Nicolai

 

You must be logged in to post in the forum