In some implementations of the Elbrus release of SuiteCommerce Advanced, the application returns incorrect results when entering more than one term in the search criteria.
The following patch corrects a problem in ItemsSearcher.View.js, which is part of the ItemsSearcher module. To implement this patch, create a custom module to change the
defaultOptions.highlightFirst property. You can download the code samples described in this procedure here: ElbrusItemSearchResultsIncorrect.zip.
Step 1: Extend ItemsSearcher.View.js
Create an extensions directory to store your custom module. Depending on your implementation, this directory might already exist.
Within this directory, create a custom module with a name similar to the module being customized.
In your new ItemsSearcherExtension@1.0.0 module, create a subdirectory called
Name this file according to best practices. For example:
Open this file and extend ItemsSearcher.View.js to customize the
highlightFirst property from
false, as shown in the following code snippet.
, function (
ItemSearcherView.prototype.defaultOptions.highlightFirst = false
Save the file.
Step 2: Prepare the Developer Tools For Your Customization
Open your new ItemsSearcherExtension@1.0.0 module directory.
Create a file in this directory and name it ns.package.json.
Paste the following code into your new ns.package.json file:
Open the distro.json file. This is located in your root directory.
Add your custom module to the
Your code should look similar to the following example:
"name": "SuiteCommerce Advanced Elbrus",
This ensures that the Gulp tasks include your module when you deploy. In this example, the custom modules are added at the beginning of the list of modules. However, you can add the modules anywhere in the
modules object. The order of precedence in this list does not matter.
ItemsSearcher.View.Extend as a dependency to SCA entry point within the
Your distro.js file should look similar to the following:
Save the distro.json file.
Step 3: Test and Deploy Your Customization
Test your source code customizations on a local server (see SCA on a Local Server) or deploy them to your NetSuite account (see Deploy to NetSuite). If you are currently running SCA on a local server, your changes should appear on your local site immediately.
Confirm your results.
Upon successful deployment, item search strings should display correct results.