I have a site which use the powerpack search filters. On the site there are some products, and each product has some variants which has a color.
We can search for products with a given color, and the search will loop out the products with the given color. It works fine, but one thing is puzzling to me.
When you add a new product to eCom it is automatically given a variant with the same details as the main product. This is fine, but if we for instance add a main product with the color black, the database will hold two entries with the same productid where the color is black. If you then search for products with the color black, both the main product and the variant will be looped out.
This makes sense in the sense that it is what a database search will return, but in my head it would make more sense if the main product wasn't looped out since your search should only return one of the same product.
My request is then. Would it be possible for you to make it an option to not loop out the main product if you apply a search filter? This makes sense in many cases since the variant will hold the same information as the main product, and unless you need to know what variants the product has, that information would be sufficient.
Developer forum
E-mail notifications
Undgå at loope hovedprodukt ud ved variantsøgning
Kasper Vesth
Posted on 14/07/2011 13:50:32
Replies
Kasper Vesth
Posted on 14/07/2011 13:54:39
http://dev.prodesigndenmark.com/en-US/Products.aspx?ID=2&eComQuery=&nzVariantColor=Black
You can see it here. The product that seems weird have is called Model 1212
You can see it here. The product that seems weird have is called Model 1212
Pavel Volgarev
Posted on 14/07/2011 14:34:44
This post has been marked as an answer
Hi Kasper,
You can use the Delimit filter with the following settings:
-- Pavel
You can use the Delimit filter with the following settings:
- Field = "IsVariant"
- Values = "True"
- Applied = "Only with other filters"
-- Pavel
Votes for this answer: 0
Kasper Vesth
Posted on 14/07/2011 14:49:27
Thank you it works like a charm :)
Kasper Vesth
Posted on 14/07/2011 14:56:56
Hi Kasper,Hmm one extra little thing. Is it possible to only apply the delimit filter when a specific other filter is used? The case is here that the filter should only be applied when searching for color. When searching for material it should work like it always have.
You can use the Delimit filter with the following settings:
This will tell the system to return only variants and not main products.
- Field = "IsVariant"
- Values = "True"
- Applied = "Only with other filters"
-- Pavel
Pavel Volgarev
Posted on 14/07/2011 15:34:10
Hi Kasper,
You will have to write some custom code in order to achieve this. In particular, you'll need to handle "AfterComposeQuery" notification and reset query generated by your Delimit filter if needed (in your case, if user searches for color).
-- Pavel
You will have to write some custom code in order to achieve this. In particular, you'll need to handle "AfterComposeQuery" notification and reset query generated by your Delimit filter if needed (in your case, if user searches for color).
I wrote a blog post about how to extend search filters. The last code example might be particularly useful for you:
-- Pavel
Kasper Vesth
Posted on 11/08/2011 13:19:47
Hi Kasper,Hi Pavel
You will have to write some custom code in order to achieve this. In particular, you'll need to handle "AfterComposeQuery" notification and reset query generated by your Delimit filter if needed (in your case, if user searches for color).I wrote a blog post about how to extend search filters. The last code example might be particularly useful for you:
-- Pavel
I am having trouble getting the notification events to fire. I have even tried subscribing to all the 5 different events just to see if any of them are made, but the OnNotify is never called it would seem, even though I apply filters to the search. Is there anything in particular I need to do or are there certain scenarios where the events are not fired?
It's still the same website as the earlier question.
Pavel Volgarev
Posted on 11/08/2011 17:03:52
Hi Kasper,
What version of the application are you using? Did you put your compiled assembly (.dll file) into the application /bin folder?
-- Pavel
What version of the application are you using? Did you put your compiled assembly (.dll file) into the application /bin folder?
-- Pavel
Kasper Vesth
Posted on 15/08/2011 09:17:30
Hi Kasper,I am using version 19.2.4.1, and put the dll in the right folder :)
What version of the application are you using? Did you put your compiled assembly (.dll file) into the application /bin folder?
-- Pavel
Kasper Vesth
Posted on 16/08/2011 14:39:00
Nevermind. I found my mistake, and it was a stupid one at that. The class I uploaded was not set to public which would explain the lack of recognition in the system.