Add Parameters Required for Shopper Access to Suitelet Internal URLs

Beginning October 30, 2024, access to the Suitelet’s internal URL for the Shopper role requires two additional parameters.

Visitors to your website are assigned the Shopper role to maintain their session while browsing. With the Shopper role, users can access the Suitelet URL for Suitelets with the Available Without Login and Select All Roles boxes checked if you have used the internal URL instead of the External URL in your site design. This may be done to maintain the shopper’s session, including for cart items.

If you use the following versions of SuiteCommerce Advanced (SCA), you will need to update the files, CMSadapter.Impl.Categories.v3.js and Logger.js.

The files must be updated to include two additional parameters, &compid=<VALUE> and &ns-at=<VALUE>, in the URL. This will ensure the Suitelet remains available and maintains the session for users with the Shopper role. The <VALUE> field should match the values of the parameters in the External URL field on the Suitelet’s script deployment record.

These patch instructions describe the steps to add the two parameters.

Be sure to follow the instructions for the version of SCA you have implemented.

Update CMSadapter and Logger Files (SCA 2018.2 and 2019.1)

Update CMSadapter.Impl.Categories.v3.ts File

  1. In NetSuite, go to Customization > Scripting > Script Deployments.

  2. Search for customdeploy_ns_sca_environment in the list of scripts and click View.

  3. From the External URL field, copy the parameter information for compid and ns-at from the URL.

  4. In your SCA directory, open the following file: Modules\suitecommerce\CMSadapter\JavaScript\CMSadapter.Impl.Categories.v3.js

  5. Search for the following method: setUpEndPoints

  6. At the end of the parameter of the method, jQuery.getJSON, add the two parameters you copied in Step 3.

    For example, find the following code:

                      (...) '_environment') 
    
                    

    And update it to the following:

                      (...) '_environment&compid=VALUE&ns-at=VALUE') 
    
                    
    Note:

    Replace the string VALUE with the values of the parameters in the External URL field on the Suitelet’s script deployment record.

  7. Save the file.

Update Logger.js File

  1. In NetSuite, go to Customization > Scripting > Script Deployments.

  2. Search for customdeploy_sca_loggerendpoint (or customscript_cs_loggerendpoint) in the list of scripts and click View.

  3. From the External URL field, copy the parameter information for compid and ns-at from the URL.

  4. In your SCA directory, open the following file: Modules\suitecommerce\Instrumentation\JavaScript\Logger.js

  5. Search for the following method: sendQueues

  6. At the end of the value of the variable, URL, add the two parameters you copied in Step 3.

    For example, find the following code:

                      (...) '_loggerendpoint'; 
    
                    

    And update it to the following:

                      (...) '_loggerendpoint&compid=VALUE&ns-at=VALUE 
    
                    
    Note:

    Replace the string VALUE with the values of the parameters in the External URL field on the Suitelet’s script deployment record.

  7. Save the file.

Update CMSadapter and Loggers Files (SCA 2019.2)

Update CMSadapter.Impl.Categories.v3.ts File

  1. In NetSuite, go to Customization > Scripting > Script Deployments.

  2. Search for customdeploy_ns_sca_environment in the list of scripts and click View.

  3. From the External URL field, copy the parameter information for compid and ns-at from the URL.

  4. In your SCA directory, open the following file: Advanced\CMSadapter\JavaScript\CMSadapter.Impl.Categories.v3.ts

  5. Search for the following method: setUpEndPoints

  6. At the end of the parameter of the method, jQuery.getJSON, add the two parameters you copied in Step 3.

    For example, find the following code:

                      (...) '_environment') 
    
                    

    And update it to the following:

                      (...) '_environment&compid=VALUE&ns-at=VALUE') 
    
                    
    Note:

    Replace the string VALUE with the values of the parameters in the External URL field on the Suitelet’s script deployment record.

  7. Save the file.

Update Loggers.Appender.ElasticLogger.ts File

  1. In NetSuite, go to Customization > Scripting > Script Deployments.

  2. Search for customdeploy_ns_sca_environment (or customscript_cs_loggerendpoint) in the list of scripts and click View.

  3. From the External URL field, copy the parameter information for compid and ns-at from the URL.

  4. In your SCA directory, open the following file: Commons\Loggers\JavaScript\Loggers.Appender.ElasticLogger.ts

  5. Search for the following method: sendQueues

  6. At the end of the value of the variable, relativeURL, add the two parameters you copied in Step 3.

    For example, find the following code:

                      (...) '_loggerendpoint'; 
    
                    

    And update it to the following:

                      (...) '_loggerendpoint&compid=VALUE&ns-at=VALUE 
    
                    
    Note:

    Replace the string VALUE with the values of the parameters in the External URL field on the Suitelet’s script deployment record.

  7. Save the file.

Related Topics

General Notices