Resolve “Sorry, We Couldn’t Find Any Products.” Error Message when using Facets with Double Quotation Marks

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:

  1. Create a custom equivalent module of ShoppingApplication@4.0.0.
  2. Customize searchApi.ssp on your Custom ShoppingApplication@4.0.0 module located under SuiteScript folder
  3. On Line 23, change the following:
  4. paramstring += (param_name + ‘=’ + params[param]) + ‘&’;
  5. With
  6. paramstring += (param_name + ‘=’ + encodeURIComponent(params[param])) + ‘&’;
  7. Save the changes
  8. Create a custom equivalent module of Facets@2.4.0
  9. Customize Facets.Translator.js on your Custom Facets@2.4.0 module located under JavaScript folder.
  10. 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
});

  1. Save the changes
  2. 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.

Leave a comment

Your email address will not be published. Required fields are marked *