Developer forum

Forum » Ecommerce - Standard features » Search suggestions filtered on group

Search suggestions filtered on group

Remi Muller
Reply
Is it currently possible to have search suggestions filtered on group?
This was not possible when implementing a site for a customer.
We have enabled search suggestion on the global search box.

On the product group pages there is also a box for quick search within a group.
What we like to have on this field is to show search suggestions but which are only relevant for the current group.

Is this possible and where should i look?

Replies

 
Remi Muller
Reply
 Excuse me for bumping. FYI topics with 0 replies dropped to the bottom.
 
Pavel Volgarev
Reply
This post has been marked as an answer
Hi Remi,

Yes, it's possible.

If you don't use customized URLs that it should work "out of the box" (if it doesn't then it's most definitely a bug). If you do use customized URLs then you need to make a small changes in the template that contains the initialization JavaScript for you suggested search. Find the line where the suggested search gets bound to the text box and add custom request parameter "GroupID" with the value set to the ID of the current eCommerce group (use "Server:Request" tag to get this value). Here is an example:
Dynamicweb.Frontend.InstantSearch.setEnableSuggestions('txFreeTextQuery', true, {
    boxID: 'divSuggestions', 
    request: { GroupID: '<!--@Server:Request.groupid-->' }
});
-- Pavel

Votes for this answer: 0
 
Remi Muller
Reply
Thank you very much. So simple but i could not find anything about it.
It also works with other filters i noticed.

 

You must be logged in to post in the forum