Hi everyone! is there any alternative for having s...
# suitecommerce
l
Hi everyone! is there any alternative for having something similar to the
defineSearchMasterOptions()
but to have it work on the SCA version 2020.2??? Is there any example for that specific version of SCA?
s
If you can't use the API method then:
Copy code
var facetsConfig = require('SC.Configuration').get('searchApiMasterOptions.Facets');
_.extend(facetsConfig, {
  'facet.exclude': 'custitem31'
});
(Obviously the required module goes in the opening define statement)
l
I'll try that. Thanks!
I'm trying the code you sent me.. but that code should only hide that facet, right? How do I make the prefilter the search to show or hide specific items?
s
Copy code
Session.getSearchApiParams = _.wrap(Session.getSearchApiParams, function (fn)
{
    var params = fn.apply(this, _.toArray(arguments).slice(1));
    params.custitem31 = 'red';
 
    return params
});
l
@Steve Goldberg Thanks Steve. And where inside an extension should I run this last code?