In some cases, search engine crawlers discard content from the page generator and do not load all the required resources to render pages correctly. This results in SuiteCommerce pages not rendering content. Applying this patch corrects this issue by maintaining the SEO pre-render result.
This patch uses the override method to replace shopping.ssp, located in the ShoppingApplication module. You can download the code samples described in this procedure here: MobileFirstIndexingPatch.zip.
prototype object. This improves the chances that your customizations continue to work when migrating to a newer version of SuiteCommerce Advanced. However, this patch requires you to modify an SSP file, which requires that you use a custom module to override the existing module file. For more information, see Customize and Extend Core SuiteCommerce Advanced Modules.
Step 1: Create the shopping.ssp Override File
Open the Modules/extensions directory and create a subdirectory to maintain your customizations and store your custom module.
Give this subdirectory a name similar to the module being customized. For example:
If you are implementing the Elbrus release of SCA or later, the extensions directory already exists in your source code. If implementing Vinson release or earlier, you must add it manually.
In your new ShoppingApplication.Extension@1.0.0 directory, create a subdirectory called
Find the following file in your existing source:
In this example, X.Y.Z represents the version of the module in your implementation of SuiteCommerce Advanced.
Copy this entire file and paste a copy in your new module’s SuiteScript directory.
Open your new copy of shopping.ssp and locate the following line:
document.getElementById("main").innerHTML = '';
Replace this line with the following code:
Save the file.
Step 2: Prepare the Developer Tools For Your Customization
Open your ShoppingApplication.Extension@1.0.0 module directory.
Create a file in this directory and name it ns.package.json.
Build the ns.package.json file using the following code:
"suitecommerce/ShoppingApplication@X.Y.Z/SuiteScript/shopping.ssp" : "SuiteScript/shopping.ssp"
In your code, replace
X.Y.Z with the version of the module in your implementation of SuiteCommerce Advanced.
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 2018.2.0 (sc-2018.2.0)",
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.
Save the distro.json file.
Step 3: Test and Deploy Your Customization
Test your source code customizations by deploying them to your NetSuite account (see Deploy to NetSuite).
Since this patch modifies a SuiteScript file, changes are not visible in your local environment. SuiteScript files run on the server and must be deployed to NetSuite to take effect.
Confirm your results.