Developer forum

Forum » Rapido » Product categories - values from reference category as facet option

Product categories - values from reference category as facet option

Mikkel Hornbech Nielsen
Reply

Hi there DW.

I am trying to setup a facet option for a product field that belongs to a product category which is a reference category.
Is this possible and how exactly?

I have setup the Products.query to take the value from the product category like so:

But its not being rendered correctly in the frontend.
It shows up on ecom groups/productlist which doesent have this product field as a value on product level.

Am i missing something or is just not possible?
The soloution is hin.stagingsite.dk if you want to try some stuff out.

So to recap, i need to show filter/facet options based on a product reference category, which holds a specific product field and its values.

Product category settings:


Hoping that you guys can help me out.


Replies

 
Mikkel Hornbech Nielsen
Reply

Did you guys see this?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Mikkel,

I have used this approach before, in one of our projects.

You have to set the Facet and Query expression to use the Reference field and not the ProductCategory field.

At least that's how it works in my project.

I hope this helps.

Adrian

 
Mikkel Hornbech Nielsen
Reply

Hi Adrian.

Yeah i saw your post, and followed that without any success, so to be honest i am not quite sure where to go from here.
The main problem is that we have a bunch of product fields, where the reference field would be ideal for using as a facet field.

But i am able to do that?
And how so exactly?

Thanks in advance.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Mikkel,
Here is a short video with how I usually do it: https://www.screencast.com/t/730hqJsK3V

Please make sure you reindex after you make changes to the Query or Facets. I can't explain why, but I have noticed that sometimes the Reference based facets are not rendering correctly after making changes to the Query or the Facet.

I hope this helps.

Adrian

 
Mikkel Hornbech Nielsen
Reply

Hi Adrian.

I have followed your screencast and done all of the steps that you have.
And all of the different filtering options is shown in the productlist (the ones with a reference field).
But its only some of the filtering options that work.
Its like its only the ones that actually holds the data on the product.

Pr instance - this product has a value in "Chemistry/Kemi" in the backend: