Issue:
An error message “Sorry, We Couldn’t Find Any Products.” is displayed on the facet of the webstore.
The problem is due to how the searchApi.ssp handles the encoding of the double-quotation marks in facets when the Require Login for Pricing feature is enabled with SuiteCommerce Advanced Elbrus Bundle.
Solution:
Prerequisites:
- Require Login for Pricing must be enabled (SuiteAnswers ID: 49670)
- Set Up Your Development Environment (SuiteAnswers ID: 44316)
- Customize and Extend (SuiteAnswers ID: 30781)
To avoid this specific behavior, kindly do the following steps:
- Create a custom equivalent module of ShoppingApplication@4.0.0.
- Customize searchApi.ssp on your Custom ShoppingApplication@4.0.0 module located under SuiteScript folder
- On Line 23, change the following:
- paramstring += (param_name + ‘=’ + params[param]) + ‘&’;
- With
- paramstring += (param_name + ‘=’ + encodeURIComponent(params[param])) + ‘&’;
- Save the changes
- Create a custom equivalent module of Facets@2.4.0
- Customize Facets.Translator.js on your Custom Facets@2.4.0 module located under JavaScript folder.
- Find the parseUrlFacet method, located on Line 325, kindly add the following condition before this.facets.push just like as shown below:
if (config.id === 'commercecategoryname' || config.id === 'category' || !name)
{
return;
}
//Add the following condition
if (value === decodeURIComponent(value))
{
value = encodeURIComponent(value);
}
this.facets.push({
config: config
, id: config.id
, url: config.id
, value: this.sanitizeValue(value, config.behavior)
, isParameter: config.isParameter
});
- Save the changes
- After applying the suggested changes, searchApi.ssp should now be able to encode double-quotation marks on facets with Require Login for Pricing feature enabled.