Site Pages Not Indexed

In some implementations of SuiteCommerce Advanced (SCA) if prerender of site pages fails, those pages may not be indexed. This issue occurs because the noindex,nofollow meta tag is not removed from the header in the shopping.ssp file as expected.

This issue has been fixed in the 2019.2 and later releases of SuiteCommerce Advanced. If you experience this issue and cannot migrate to the latest release, you can fix this issue as described in the following procedure.

To implement this patch, create a custom module to override the shopping.ssp file, which is part of the ShoppingApplication module. The location of this file depends on the SCA release that you need to patch:

2019.1

.../Modules/suitecommerce/ShoppingApplication@sc-2019.1.0/SuiteScript/shopping.ssp

2018.2

.../Modules/suitecommerce/ShoppingApplication@sc-2018.2.0/SuiteScript/shopping.ssp

Aconcagua

.../Modules/suitecommerce/ShoppingApplication@aconcaguaR2/SuiteScript/shopping.ssp

Kilimanjaro

.../Modules/suitecommerce/ShoppingApplication@4.1.0/SuiteScript/shopping.ssp

Elbrus

.../Modules/suitecommerce/ShoppingApplication@4.0.0/SuiteScript/shopping.ssp

Vinson

.../Modules/suitecommerce/ShoppingApplication@3.0.0/SuiteScript/shopping.ssp

Montblanc

.../Modules/suitecommerce/ShoppingApplication@2.1.0/SuiteScript/shopping.ssp

Denali

.../Modules/suitecommerce/ShoppingApplication@2.0.8/SuiteScript/shopping.ssp

If you are not familiar with implementing patches for SCA, refer to the following:

Step 1: Create the Override File

Following the instructions and recommendations in the Patch Using Override Mode procedure, copy and paste the following code samples in the new directory and file you create: .../Modules/extensions/ShoppingApplicationExtension@1.00/SuiteScript/shopping.ssp

  1. Find the following lines of code in the <head> tag:

                    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="robots" content="nofollow,noindex">
    <link rel="shortcut icon" href="<%= session.getAbsoluteUrl("shopping", "img/favicon.ico") %>" />
    <title>Shopping</title> 
    
                  
  2. And replace them with the following code:

                    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="shortcut icon" href="<%= session.getAbsoluteUrl("shopping", "img/favicon.ico") %>" />
    <title></title> 
    
                  
  3. Find and remove the following if block:

                    if (SC.isPageGenerator())
       {
          var metas = document.head.getElementsByTagName('meta');
    
          for (var i = 0; i < metas.length; i++)
          {
             if (metas[i].getAttribute('content') === 'nofollow,noindex')
             {
                document.head.removeChild(metas[i]);
             }
          }
       } 
    
                  

Step 2: Prepare the Developer Tools For Your Patch

When preparing the Developer Tools for your patch as described in the Patch Using Override Mode procedure, you should:

  1. Paste the following sample code into the new ns.package.json file that you create in the Modules directory: .../Modules/extensions/ ShoppingApplicationExtension@1.00/ns.package.json

                    {
       "gulp": {
          "ssp-files": [
             "SuiteScript/*.ssp"
          ]
       },
       "overrides": {
          "suitecommerce/ShoppingApplication@X.Y.Z/SuiteScript/shopping.ssp" : "SuiteScript/shopping.ssp"
       }
    } 
    
                  
    Important:

    In the preceding code sample, you must replace the string X.Y.Z with the version of the module in your implementation of SuiteCommerce Advanced.

  2. Open the distro.json file and then add your custom module to the modules object as described in the Patch Using Override Mode procedure. This file is located in the top-level directory. For example, for the 2018.2 release, if you accepted the default directory name for your release, the top-level directory would be SuiteCommerce Advanced 2018.2.

    The following sample shows the value to add to the list of existing values that follow the "modules" key.

                    "modules": {
        "extensions/ShoppingApplicationExtension": "1.0.0",
        . . . 
    
                  

Step 3: Test and Deploy Your Patch

Follow the instructions provided in the Patch Using Override Mode procedure to test and deploy your patch.

  1. Test your patch by deploying to NetSuite (see Deploy SCA Customizations to NetSuite). Because 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.

  2. Confirm your results.

Related Topics

SCA Patches

General Notices