I have a client that needs a specific set up with regards the search. They have customers that have a restricted catalog and so certain results should not be included in the response on a per customer basis.
To test how possible this was to do I modified the common.js file in the plugin and added
options.facetFilters = 'sku:-30066';. This worked perfectly but is clearly not the correct way to do it as I don’t want to modify any core files. Also I have had to make sku a facet which is not ideal but okay I think.
What is the best approach for this?
I have experimented with adding a custom source to the autocomplete.js that is basically a copy of the products source in the common.js with some minor tweaks.
Ideally at run time I would just like to set an exclude list and the plugin reads that in as default options.
I am using v1.9.0 of the plugin