Shopping User Environment Experiences Degraded Performance

In some implementations of SuiteCommerce Advanced (SCA), shopping.user.enivornment.ssp experiences degraded performance. For example, time to first byte (TTFB) may increase from less than 500 milliseconds to 2 seconds. These patch instructions describe how to correct this problem.

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:

Aconcagua

SuiteCommerce Advanced Aconcagua/Modules/suitecommerce/ShoppingApplication@aconcaguaR2/SuiteScript/shopping.ssp

2018.2

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

2019.1

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

2019.2

SuiteCommerce Advanced 2019.2/SC_19.2_Live/Advanced/ShoppingApplication/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 sample in the new directory and file you create. Where you create the new directory and file depends on the SCA release that you need to patch:

Aconcagua, 2018.2, and 2019.1

.../Modules/extensions/ShoppingApplicationExtension@1.00/SuiteScript/shopping.ssp

2019.2

.../SC_19.2_Live/Advanced/extensions/ShoppingApplicationExtension@1.00/SuiteScript/shopping.ssp

  • For the Aconcagua release, find this line:

                    new_script_tag.src = '<%= session.getAbsoluteUrl2("shopping.user.environment.ssp?lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %>&t=' + datetime + ""; 
    
                  

    And replace it with the following code:

                    new_script_tag.src = '<%= session.getAbsoluteUrl2("shopping.user.environment.ssp?lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %> + ""; 
    
                  
  • For the 2018.2, 2019.1, and 2019.2 releases, find this line:

                    loadJSON('<%= session.getAbsoluteUrl2("services/ShoppingUserEnvironment.Service.ss?lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %>'+ googletagmanager_cookie + '&t=' + datetime + "", 'shoppingUserEnvironment') 
    
                  

    And replace it with the following code:

                    loadJSON('<%= session.getAbsoluteUrl2("services/ShoppingUserEnvironment.Service.ss?lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %>'+ googletagmanager_cookie + "", 'shoppingUserEnvironment') 
    
                  

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 code appropriate for the SCA release you are patching into a new ns.package.json file that you create. Where you create the ns.package.json file depends upon the release you are working with.

    Aconcagua, 2018.2, and 2019.1

    .../Modules/extensions/ShoppingApplicationExtension@1.00/ns.package.json

    2019.2

    .../SC_19.2_Live/Advanced/extensions/ShoppingApplicationExtension@1.00/ns.package.json

    • Use the following code if you are patching the Aconcagua, 2018.2, or 2019.1 release.

                          {
         "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.

    • Use the following code if you are patching the 2019.2 release.

                          {
         "gulp": {
            "ssp-files": [
               "SuiteScript/*.ssp"
            ]
         },
         "overrides": {
            "suitecommerce/ShoppingApplication/SuiteScript/shopping.ssp" : "SuiteScript/shopping.ssp"
         }
      } 
      
                        
  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. The location of the distro.json file depends on the version of SCA you are patching.

    Aconcagua, 2018.2, and 2019.1

    For these releases, the distro.json file resides in the top-level directory. If you accepted the default directory name for your release, these would be SuiteCommerce Advanced Aconcagua, SuiteCommerce Advanced 2018.2, and SuiteCommerce Advanced 2019.1.

    2019.2

    For this release, the distro.json file resides in the SC_19.2_Live/Advanced directory. If you accepted the default name for the top-level directory, the complete path is: SuiteCommerce Advanced 2019.2/SC_19.2_Live/Advanced/distro.json.

    The following sample shows the value to add to the list of existing values that follow the “modules” key. Refer to the appropriate sample for the version of SCA you are working with.

    • Use the following sample if you are patching the Aconcagua, 2018.2, or 2019.1 release.

                          "modules": {
          "extensions/ShoppingApplicationExtension": "1.0.0",
          . . . 
      
                        
    • Use the following sample if you are patching the 2019.2 release.

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

Step 3: Test and Deploy Your Patch

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

Related Topics

SCA Patches

General Notices