beforeShowContent Event Stops Working After Initial Trigger

In some implementations of SuiteCommerce Advanced (SCA), the beforeShowContentEvent stops working after the initial trigger in these components: ProductListPageComponent and ProductDetailsComponent. These patch instructions describe how to correct this problem.

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

2019.1

SuiteCommerce Advanced 2019.1/Modules/suitecommerce/NavigationHelper@sc-2019.1.0/JavaScript/NavigationHelper.Plugins.Modals.js

2019.2

SuiteCommerce Advanced 2019.2/SC_19.2_Live/Commons/NavigationHelper/JavaScript/NavigationHelper.Plugins.Modals.ts

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

Step 1: Create the Override File

Following the instructions and 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:

2019.1

.../Modules/extensions/NavigationHelperExtension@1.0.0/JavaScript/NavigationHelper.Plugins.Modals.js

2019.2

.../SC_19.2_Live/Commons/extensions/NavigationHelperExtension@1.0.0/JavaScript/NavigationHelper.Plugins.Modals.ts

Find this line:

            layout.originalShowContent = layout._showContent; 

          

And replace it with the following code:

            layout.originalShowContent = layout.showContent 

          

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.

    2019.1

    .../Modules/extensions/NavigationHelperExtension@1.0.0/ns.package.json

    2019.2

    .../SC_19.2_Live/Commons/extensions/ NavigationHelperExtension@1.0.0/ns.package.json

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

                          {
         "gulp": {
            "javascript": [
               "JavaScript/*.js"
            ]
         },
         "overrides": {
            "suitecommerce/NavigationHelper@SC-2019.1.0/JavaScript/NavigationHelper.Plugins.Modals.js" : "JavaScript/NavigationHelper.Plugins.Modals.js"
         }
      } 
      
                        
    • Use the following code if you are patching the 2019.2 release.

                          {
         "gulp": {
            "javascript": [
               "JavaScript/*.js"
            ]
         },
         "overrides": {
            "suitecommerce/NavigationHelper/JavaScript/NavigationHelper.Plugins.Modals.ts" : "JavaScript/NavigationHelper.Plugins.Modals.ts"
         }
      } 
      
                        
  2. Open the distro.json file and then add your extension 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.

    2019.1

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

    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 2019.1 release.

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

                          "modules": {
          "../Commons/extensions/NavigationHelperExtension",
          . . . 
      
                        

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