Migration Tasks

This migration is highly technical and involves customizing multiple files. Update the following files in each SSP Application to use the new domain check methods as well as the new session check method where applicable:

In addition, complete these tasks.

Important:

This document is intended to be a guide only. It is not a comprehensive procedure that guarantees a correct implementation of HTTPS support for your web store.

Before you begin making changes, back up any custom files that already exist. Be careful not to overwrite existing custom files.

For each file, go to the SSP Application under Documents > Files > File Cabinet > Web Site Hosting Files > Live Hosting Files > SSP Applications and copy the Reference files to the same location in the Custom folder.

Note:

Checkout with Content Delivery Network (CDN) enabled is not supported by pre-Denali versions of SCA. As a workaround, see Checkout With CDN to enable CDN on a pre-Denali checkout flow.

To modify files for HTTPS:

  1. Open each file at the specified location in the Custom folder.

  2. Search each file for the appropriate location using the line number or surrounding text from the code snippet.

    Use the following conventions to determine when you need to add or remove code.

                    --- = Remove this line of code.
    +++ = Add this line of code.
    
    Note: Surrounding text and line numbers vary depending on each SSP Application as well as existing customizations. They are included as reference points only. 
    
                  
  3. Add or remove statements as indicated in the code snippet and save.

commons.js

File locations:

Add the entire Utils variable to the Utilities section of each commons.js file. The Utils variable contains the new methods that distinguish between the domains.

          ...

    // Utilites
+++         var Utils = {
+++
+++             // @method isCheckoutDomain determines if we are in a secure checkout
+++             // domain or in a secure single domain environment
+++             // @return {Boolean} true if in checkout or in single domain
+++             isCheckoutDomain: function isCheckoutDomain()
+++             {
+++                 return session.isCheckoutSupported();
+++             }
+++             // @method isShoppingDomain determines if we are in shopping domain (secure or non secure)
+++             // or in a secure single domain environment
+++             // @return {Boolean} true if in shopping or single domain
+++         ,   isShoppingDomain: function isShoppingDomain()
+++             {
+++                 return session.isShoppingSupported();
+++             }
+++             // @method isSingleDomain determines if we are in a single domain environment
+++             // @return {Boolean} true if single domain
+++         ,   isSingleDomain: function isSingleDomain()
+++             {
+++                 return this.isShoppingDomain() && this.isCheckoutDomain();
+++             }
+++             // @method isInShopping determines if we are in shopping ssp
+++             // @return {Boolean} true if in shopping domain, false if in checkout or myaccount
+++         ,   isInShopping: function isInShopping (request)
+++             {
+++                 return this.isShoppingDomain() && (request.getHeader('X-SC-Touchpoint') === 'shopping' || request.getParameter('X-SC-Touchpoint') === 'shopping');
+++             }
+++             // @method isInCheckout determines if we are in checkout ssp or my account ssp
+++             // @return {Boolean} true if in checkout domain
+++         ,   isInCheckout: function isInCheckout (request)
+++             {
+++                 var self = this;
+++
+++                 if (!self.isSingleDomain())
+++                 {
+++                     return self.isCheckoutDomain();
+++                 }
+++                 else
+++                 {
+++                     var paypal_complete = ModelsInit.context.getSessionObject('paypal_complete') === 'T'
+++                     ,   is_in_checkout = request.getHeader('X-SC-Touchpoint') === 'checkout' ||
+++                                     request.getHeader('X-SC-Touchpoint') === 'myaccount' ||
+++                                     request.getParameter('X-SC-Touchpoint') === 'checkout' ||
+++                                     request.getParameter('X-SC-Touchpoint') === 'myaccount';
+++                     return self.isCheckoutDomain() && (is_in_checkout || paypal_complete);
+++                 }
+++             }
+++         }

... 

        

Call the new session.isLoggedIn2() method to maintain user identity.

          ...
999:    function isLoggedIn ()
        {
            'use strict';
---         // MyAccount (We need to make the following difference because isLoggedIn is always false in Shopping)
---         if (request.getURL().indexOf('https') === 0)
---         {
---             return session.isLoggedIn();
---         }
---         else // Shopping
---         {
---             return parseInt(nlapiGetUser() + '', 10) > 0 && !session.getCustomer().isGuest();
---         }

+++         return session.isLoggedIn2();
        }

... 

        

Modify the getEnvironment() method to add the new domain check methods.

          ...
        ,   init: function () {}
220:    ,   getEnvironment: function (session, request)
            {
                'use strict';
                // Sets Default environment variables
                var context = nlapiGetContext()
---             ,   isSecure = request.getURL().indexOf('https:') === 0;
+++             ,   isSecure = Utils.isCheckoutDomain();

                ,   siteSettings = session.getSiteSettings(['currencies', 'languages'])
                ,   result = {
---                         baseUrl: session.getAbsoluteUrl(isSecure ? 'checkout' : 'shopping', '/{{file}}')
+++                         baseUrl: session.getAbsoluteUrl(Utils.isInCheckout(request)  ? 'checkout' : 'shopping', '/{{file}}')
                        ,   currentHostString: request.getURL().match('http(s?)://(.*)/')[2]
                        ,   availableHosts: SC.Configuration.hosts || []
                        ,   availableLanguages: siteSettings.languages || []
                        ,   availableCurrencies: siteSettings.currencies || []
                        ,   companyId: context.getCompany()
                        ,   casesManagementEnabled: context.getSetting('FEATURE', 'SUPPORT') === 'T'
                        ,   giftCertificatesEnabled: context.getSetting('FEATURE', 'GIFTCERTIFICATES') === 'T'
                    };
                // If there are hosts asociated in the site we iterate them to check which we are in
                // and which language and currency we are in
---             if (result.availableHosts.length && !isSecure)
+++             if (result.availableHosts.length && Utils.isShoppingDomain())
                {
                    for (var i = 0; i < result.availableHosts.length; i++)

... 

        

Utils.js

File locations:

Update the getDownloadPdfUrl() method to add the new domain check methods.

          ...
635:    function getDownloadPdfUrl (params)
        {
---         params = params || {};
---         params.n = SC.ENVIRONMENT.siteSettings.siteid;
---         var origin = window.location.origin ? window.location.origin :
---                 (window.location.protocol + '//' + window.location.hostname + (window.location.port ? (':' + window.location.port) : ''));
---         return  _.addParamsToUrl(origin + _.getAbsoluteUrl('download.ssp'), params);

+++         params = params || {};
+++         params.n = SC && SC.ENVIRONMENT && SC.ENVIRONMENT.siteSettings && SC.ENVIRONMENT.siteSettings.siteid || '';
+++        
+++         if(_.isSingleDomain())
+++         {
+++             return  _.addParamsToUrl(_.getAbsoluteUrl('download.ssp'), params);
+++         }
+++         else
+++         {
+++             var origin = window.location.origin ? window.location.origin :
+++             (window.location.protocol + '//' + window.location.hostname + (window.location.port ? (':' + window.location.port) : ''));
+++        
+++             return  _.addParamsToUrl(origin + _.getAbsoluteUrl('download.ssp'), params);
+++         }

        }

...

797:    function reorderUrlParams (url)
        {
            var params = []
            ,   url_array = url.split('?');
            if (url_array.length > 1)
            {
                params = url_array[1].split('&');
                return url_array[0] + '?' + params.sort().join('&');
            }
            return url_array[0];
        }


+++     // @method isShoppingDomain determines if we are in shopping domain (secure or non secure)
+++     // or single domain
+++     // @return {Boolean} true if in checkout or in single domain
+++     function isShoppingDomain ()
+++     {
+++         return SC.ENVIRONMENT.siteSettings.shoppingSupported;
+++     }
+++
+++     // @method isCheckoutDomain determines if we are in a secure checkout
+++     // domain or in a secure single domain environment
+++     // @return {Boolean} true if in checkout or in single domain
+++     function isCheckoutDomain ()
+++     {
+++         return SC.ENVIRONMENT.siteSettings.checkoutSupported;
+++     }
+++
+++     // @method isSingleDomain determines if we are in a single domain environment
+++     // @return {Boolean} true if single domain
+++     function isSingleDomain ()
+++     {
+++         return SC.ENVIRONMENT.siteSettings.isSingleDomain;
+++     }
+++
+++     // @method isInShopping determines if we are in shopping ssp
+++     // used when there are frontend features only shown in the shopping domain
+++     // @return {Boolean} true if in shopping domain, false if in checkout or myaccount
+++     function isInShopping ()
+++     {
+++         return _.isShoppingDomain() && (SC.ENVIRONMENT.SCTouchpoint === 'shopping' || SC.ENVIRONMENT.siteSettings.sitetype === 'STANDARD');
+++     }
+++
+++     // @method isInCheckout determines if we are in checkout or my account ssp
+++     // @return {Boolean} true if in checkout domain
+++     function isInCheckout ()
+++     {
+++         return !_.isSingleDomain() ? _.isCheckoutDomain() : _.isCheckoutDomain() && (SC.ENVIRONMENT.SCTouchpoint === 'checkout' ||  SC.ENVIRONMENT.SCTouchpoint === 'myaccount');
+++     }
... 

        

Models.js

File locations:

Verify the domain using the new domain check methods.

          ...

19:     Application.defineModel('SiteSettings', {

...

121:    settings.is_logged_in = session.isLoggedIn();
        settings.touchpoints = basic_settings.touchpoints;
        settings.shopperCurrency = session.getShopperCurrency();

...

+++     settings.checkoutSupported = Utils.isCheckoutDomain();
+++     settings.shoppingSupported = Utils.isShoppingDomain();
+++     settings.isSingleDomain = settings.checkoutSupported && settings.shoppingSupported;

... 

        

Call the new session.isLoggedIn2() method and update the getFieldValues() method to use the new domain check methods.

          ...

167:            Application.defineModel('LiveOrder', {

...

309:    ---    ,   isSecure: request.getURL().indexOf('https') === 0
        ---    ,   isLoggedIn: session.isLoggedIn()

        +++    ,   isLoggedIn: session.isLoggedIn2()
        +++    ,   isSecure: Utils.isCheckoutDomain()

...

681:             ,   getFieldValues: function ()
                     {
                       'use strict';
        ---             var order_field_keys = this.isSecure ? SC.Configuration.order_checkout_field_keys : SC.Configuration.order_shopping_field_keys;
        +++             var order_field_keys = Utils.isInCheckout(request) && session.isLoggedIn2() ? SC.Configuration.order_checkout_field_keys : SC.Configuration.order_shopping_field_keys; 

... 

        

Update the verifySession() method to remove the legacy domain check.

          ...

1726:       Application.defineModel('ProductList', {

...

            // Returns a product list based on a given userId and id
1759:       ,   get: function (user, id)
                {
---                 // Verify session if and only if we are in My Account...
---                 if (request.getURL().indexOf('https') === 0)
---                 {
---                     this.verifySession();
---                 }
+++           this.verifySession();

...

            // Retrieves all Product Lists for a given user
1896:       ,   search: function (user, order)
                {
---                  // Verify session if and only if we are in My Account...
---                 if (request.getURL().indexOf('https') === 0)
---                 {
--- ,                     this.verifySession();
---                 }

                    var filters = [new nlobjSearchFilter('isinactive', null, 'is', 'F')
                    ,   new nlobjSearchFilter('custrecord_ns_pl_pl_owner', null, 'is', user)]
                    ,   template_ids = []

... 

        

sc.environment.ssp

File locations:

Add a touchpoint check for Checkout and update the session.GetAbsoluteUrl() parameters to replace the legacy domain check.

          ...

94:     <% if (SiteSettings) { %>
            // Site Settings Info
            <%
            // under some wired cases the terms and conditions bring a script tag if there is a body tag present
            // This code eliminates it in the case
            var site_settings_json = JSON.stringify(SiteSettings).replace(/
>/ig, '').replace(/<\/body*?>/ig, '')
            %>
            SC.ENVIRONMENT.siteSettings = <%= site_settings_json %>;
            // Site site (ADVANCED or STANDARD)
            SC.ENVIRONMENT.siteType = '<%= SiteSettings.sitetype %>';

+++         // SCTouchpoint indicates the touchpoint the user is effectively in. We can only know with certain this in the proper ssp
+++         // because there is still code that depends on the touchpoint
+++         // when in single ssp check if this it's necessary
+++         SC.ENVIRONMENT.SCTouchpoint = 'checkout';
        <% } %>

...

179:        if(!SC.ENVIRONMENT.baseUrl)
            {
---             SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl(request.getURL().indexOf('https:') === 0 ? 'checkout' : 'shopping', '/{{file}}') %>';
+++             SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl('checkout', '/{{file}}') %>';
            }

... 

        

Add a touchpoint check for MyAccount and update the session.GetAbsoluteUrl() parameters to replace the legacy domain check.

          ...

106:    <% if (SiteSettings) { %>
            // Site Settings Info
            SC.ENVIRONMENT.siteSettings = <%= JSON.stringify(SiteSettings) %>;
            // Site site (ADVANCED or STANDARD)
            SC.ENVIRONMENT.siteType = '<%= SiteSettings.sitetype %>';

+++         // SCTouchpoint indicates the touchpoint the user is effectively in. We can only know with certain this in the proper ssp
+++         // because there is still code that depends on the touchpoint
+++         // myaccount value is added just in case someone needs it
+++         // when in single ssp check if this it's necessary
+++         SC.ENVIRONMENT.SCTouchpoint = 'myaccount';
         
        <% } %>

...

205:    if(!SC.ENVIRONMENT.baseUrl)
        {
---         SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl(request.getURL().indexOf('https:') === 0 ? 'checkout' : 'shopping', '/{{file}}') %>';
+++         SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl('checkout', '/{{file}}') %>';
        }

... 

        

Add a touchpoint check for ShopFlow and update the session.GetAbsoluteUrl() parameters to replace the legacy domain check.

          ...

73:     <% if (SiteSettings) { %>
            // Site Settings Info
            SC.ENVIRONMENT.siteSettings = <%= JSON.stringify(SiteSettings) %>;

+++         // SCTouchpoint indicates the touchpoint the user is effectively in. We can only know with certain this in the proper ssp
+++         // because there is still code that depends on the touchpoint
+++         // when in single ssp check if this it's necessary
+++         SC.ENVIRONMENT.SCTouchpoint = 'shopping';

        <% } %>

...

115:  if (!SC.ENVIRONMENT.baseUrl)
      {
---        SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl(request.getURL().indexOf('https:') === 0 ? 'checkout' : 'shopping', '/{{file}}') %>';
+++        SC.ENVIRONMENT.baseUrl = '<%=  session.getAbsoluteUrl('shopping', '/{{file}}') %>';
      }

... 

        

index.ssp and index-local.ssp

File locations:

Modify each of these files to add the &X-SC-Touchpoint= query parameter when requesting sc.environment.ssp and sc.user.environment.ssp.

ShopFlow > Custom ShopFlow > index.ssp

          ...

146:    <script>
            if (!SC.isCrossOrigin())
            {
                // Do we have SEO Support
                if (SC.isPageGenerator())
                {
                    document.body.className = document.body.className + ' seo-support';
                }
                SC.ENVIRONMENT.seoSupport = !!~document.body.className.indexOf("seo-support");
                /* load language and sc.environment.ssp */
                loadScript([
---                 '<%= session.getAbsoluteUrl("shopping", "sc.environment.ssp?lang=" + Language + "&cur=" + Currency) %>'
+++                 '<%= session.getAbsoluteUrl("shopping", "sc.environment.ssp?lang=" + Language + "&cur=" + Currency  + "&X-SC-Touchpoint=shopping") %>'
                ,   '<%= session.getAbsoluteUrl("shopping", "languages/" + Language + ".js") %>'
                ]);
                if (SC.isPageGenerator())
                {
                    SC.ENVIRONMENT.PROFILE = {};
                }
                // Loads the application files, if you need to have a less agresive cacheing you can move them
                // to the sc.environment.ssp (Moderate cacheing) or to the sc.user.environment.ssp (No cache but less performant)
                loadScript([
                    '<%= session.getAbsoluteUrl("shopping", 'js/libs/Libraries-014c760ca5c2.js') %>'
                ,   '<%= session.getAbsoluteUrl("shopping", 'templates/Templates-0152658bf631.js') %>'
                ,   '<%= session.getAbsoluteUrl("shopping", 'js/Application-01526a8e6d58.js') %>'
                // ,    '/cms/1/cms.js'
                ]);
                if (SC.ENVIRONMENT.jsEnvironment == 'browser')
                {
                    loadScript({
---                     url: '<%= session.getAbsoluteUrl("shopping", "sc.user.environment.ssp?lang=" + Language + "&cur=" + Currency) %>&t=' + new Date().getTime()
+++                     url: '<%= session.getAbsoluteUrl("shopping", "sc.user.environment.ssp?lang=" + Language + "&cur=" + Currency  + "&X-SC-Touchpoint=shopping") %>&t=' + new Date().getTime()
                    ,   async: true
                    });
                }
            }
        </script>

... 

        

MyAccount > Custom MyAccount > index.ssp

          ...

            <script>
            var SC = window.SC = {
                ENVIRONMENT: {
                    jsEnvironment: (typeof nsglobal === 'undefined') ? 'browser' : 'server'
                }
                , isCrossOrigin: function() { return '<%= Environment.currentHostString %>' !== document.location.hostname; }
                , isPageGenerator: function() { return typeof nsglobal !== 'undefined'; }
                , getSessionInfo: function(key)
                {
                    var session = SC.SESSION || SC.DEFAULT_SESSION || {};
                    return (key) ? session[key] : session;
                }
            };
        </script>
65:     --- <script> src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency) %>"</script>
65:     +++ <script> src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency + "&X-SC-Touchpoint=myaccount") %>"</script>

... 

        

Checkout > Custom Checkout > index.ssp

          ...

139:    <% if (login) { %>
---         <script src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") ) %>"></script>
+++         <script src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") + "&X-SC-Touchpoint=checkout" ) %>"></script>
        <% } else { %>
        <script>
            loadScript({
---             url: '<%= session.getAbsoluteUrl("checkout", "sc.environment.ssp?lang=" + Language + "&cur=" + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") ) %>&t=' + (new Date().getTime())
+++             url: '<%= session.getAbsoluteUrl("checkout", "sc.environment.ssp?lang=" + Language + "&cur=" + Currency + (cart_bootstrap ? "&cart-bootstrap=T" : "") + "&X-SC-Touchpoint=checkout" ) %>&t=' + (new Date().getTime())
            });
        </script>
        <% } %>

... 

        

ShopFlow > Custom ShopFlow > index-local.ssp

          ...

80:     /* load language and sc.environment.ssp */
        loadScript([
---         '<%= session.getAbsoluteUrl("shopping", "sc.environment.ssp?v=711&lang=" + Language + "&cur=" + Currency) %>'
+++         '<%= session.getAbsoluteUrl("shopping", "sc.environment.ssp?v=711&lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %>'
        ,   '<%= session.getAbsoluteUrl("shopping", "languages/" + Language + ".js") %>'
        ]);
        if (SC.ENVIRONMENT.jsEnvironment === 'server')
        {
            SC.ENVIRONMENT.PROFILE = {};
        }
        loadScript([
            '<%= root %>templates/Templates.php'
        ,   '<%= root %>js/Application.php'  
        ]);

        if (SC.ENVIRONMENT.jsEnvironment == 'browser')
        {
            loadScript({
---             url: '<%= session.getAbsoluteUrl("shopping", "sc.user.environment.ssp?lang=" + Language + "&cur=" + Currency) %>&t=' + new Date().getTime()
+++             url: '<%= session.getAbsoluteUrl("shopping", "sc.user.environment.ssp?lang=" + Language + "&cur=" + Currency + "&X-SC-Touchpoint=shopping") %>&t=' + new Date().getTime()
            ,   async: true
            });
        }

... 

        

MyAccount Premium> Custom MyAccount Premium > index-local.ssp

          ...

            <script src="<%= root %>js/utils/BootUtilities.js"></script>
70: ---     <script src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency) %>"></script>
    +++     <script src="<%= session.getAbsoluteUrl('checkout', 'sc.environment.ssp?lang=' + Language + '&cur=' + Currency + '&X-SC-Touchpoint=myaccount') %>"></script>

... 

        

jQuery.ajaxSetup.js

File locations:

Update the beforeSend() method to send the header to the backend for each request.

          ...

        // This registers an event listener to any ajax call
85:     jQuery(document)
            // http://api.jquery.com/ajaxStart/
            .ajaxStart(SC.loadingIndicatorShow)
            // http://api.jquery.com/ajaxStop/
            .ajaxStop(SC.loadingIndicatorHide);
        // http://api.jquery.com/jQuery.ajaxSetup/

        jQuery.ajaxSetup({
93:     beforeSend: function (jqXhr, options)
        {
            // BTW: "!~" means "== -1"
            if (!~options.contentType.indexOf('charset'))
            {
                // If there's no charset, we set it to UTF-8
                jqXhr.setRequestHeader('Content-Type', options.contentType + '; charset=UTF-8');
            }

+++         // Add header so that suitescript code can know the current touchpoint
+++         jqXhr.setRequestHeader('X-SC-Touchpoint', SC.ENVIRONMENT.SCTouchpoint);
        }

... 

        

live-order.ss and live-order-line.ss

File locations:

In each file, add an if statement to verify if the user is in shopping or logged in.

          ...

        // If we are not in the checkout OR we are logged in
        // When on store, login in is not required
        // When on checkout, login is required
---     if (!~request.getURL().indexOf('https') || session.isLoggedIn())
+++     if (Utils.isInShopping(request) || session.isLoggedIn2())

... 

        

CheckoutSkipLogin.js

Customizing this file requires that you copy the CheckoutSkipLogin module folder from Reference Checkout to Custom Checkout because it is not created automatically.

Update Checkout > Custom Checkout > js > src > app > modules > CheckoutSkipLogin > CheckoutSkipLogin.js to use the new domain check method.

                           return promise;
                };
   
        ---     // don't wrap on non-secure domains (Site Builder cart is in Checkout :/ )
89:     ---     if (window.location.protocol !== 'http:')
        +++     // Site Builder cart is in Checkout :/ don't wrap if in shopping
        +++     if (Utils.isInCheckout())
                {
                    LiveOrderModel.prototype.save = _.wrap(LiveOrderModel.prototype.save, wrapper);
                }

... 

        

NavigationHelper.js

Customizing this file requires that you copy the NavigationHelper module folder from Reference ShopFlow to Custom Shopflow because it is not created automatically.

File locations:

Add the new domain check methods in each of the files.

          ...
                // if we are heading to a secure domain (myAccount or checkout), keep setting the language by url
299:    ---     if (target_touchpoint.indexOf('https:') >= 0)
        +++     if (Utils.isInCheckout())
                {
                    var current_language = SC.ENVIRONMENT.currentLanguage;
                    if (current_language)
                    {
                        target_data.parameters = target_data.parameters ?
                                target_data.parameters + '&lang=' + current_language.locale :
                                'lang=' + current_language.locale;
                    }
                }

... 

        

Update Legacy Checks and Methods

Previous sections have covered customizing multiple files. This procedure provides steps for finding and replacing any other instances of the legacy domain checks, the legacy getAbsoluteUrl() methods, and the legacy session.isLoggedIn() methods.

To update the legacy checks and methods:

  1. Search the files for remaining instances of these legacy domain checks.

    • !~request.getURL().indexOf('https')

    • isSecure

    • isSecureDomain

    1. If instances are located in files that have not already been copied to the Custom folder, copy as needed.

    2. For each instance, determine the reason for the domain check.

      • Was it to protect a resource from being accessed through the shopping domain? In this case, call the Utils.isCheckoutDomain() method.

      • Does the method return a different result depending on whether we are in the checkout domain or the shopping domain? In this case, call the Utils.isInCheckout() method.

      • Is there a visual change in the web store depending on whether we are in the checkout domain or the shopping domain? Call the Utils.isInCheckout() method or the Utils.isInShopping() method as appropriate for each domain.

    3. Replace each instance with the appropriate new domain check method.

      See the code snippet in commons.js for the method definitions.

      • Utils.isCheckoutDomain()

      • Utils.isInCheckout()

      • Utils.isInShopping()

      • Utils.isSingleDomain()

  2. Search the files for remaining instances of:

    session.getAbsoluteUrl(request.getURL().indexOf('https:') === 0 ? 'checkout' : 'shopping', '/{{file}}') :

    1. If instances are located in files that have not already been copied to the Custom folder, copy as needed.

    2. In Checkout or MyAccount, replace the instance with session.getAbsoluteUrl( 'checkout', '/{{file}}').

    3. In Shopping, replace the instance with session.getAbsoluteUrl( 'shopping', '/{{file}}').

    4. You can also replace any instance with:

      session.getAbsoluteUrl(Utils.isInCheckout(request) ? 'checkout' : 'shopping', '/{{file}}').

      This method call will check for either domain.

  3. Search the files for remaining instances of the session.isLoggedIn() method.

    1. If instances are located in files that have not already been copied to the Custom folder, copy as needed.

    2. Replace each instance with the session.isLoggedIn2() method.

Deploy the Migration

When all customizations are complete, you need to configure NetSuite to use the custom files instead of the reference files. Complete the following tasks:

Important:

These customizations are extensive. You should test them in a sandbox account or other test site before deploying to a production account.

To deploy the migration:

  1. If you have not already done so, complete the steps to configure a Secure Domain. For details, refer to Set Up Domains for Web Stores.

  2. Go to Commerce > Hosting > SSP Applications.

  3. Click Edit to modify the custom SSP Application.

  4. On the Library subtab under Scripts, add the library scripts as indicated:

    Important:

    The order of these scripts must match exactly.

    Web Site Hosting Files/Live Hosting Files/SSP Applications/<application>/...

    • ... Reference <SSP Application>/ssp_libraries/underscore.js

    • ... Reference <SSP Application>/ssp_libraries/backbone.validation.js

    • ... Custom <SSP Application>/ssp_libraries/commons.js

    • ... Reference <SSP Application>/ssp_libraries/backend.configuration.js

    • ... Custom <SSP Application>/ssp_libraries/Models.js

    For example, to update the commons.js file for ShopFlow 1.07.0, go to:

    Web Site Hosting Files/Live Hosting Files/SSP Applications/NetSuite Inc. — ShopFlow 1.07.0/Custom ShopFlow /ssp_libraries/commons.js

  5. Click on the Supported Touch Points subtab.

  6. Add the appropriate touch points using the custom .ssp files that were modified as part of this migration. See Select Supported Touch Points.

  7. Click Save.

  8. Deploy the Custom SSP Applications to your Secure Domain.

    1. Select the Save & Link to Domain button (from the Save drop down menu).

    2. Choose your secure domain.

    3. Click Save.

  9. Repeat the Scripts, Touch Points, and Deploy steps for each SSP Application you customized (Custom Checkout, Custom MyAccount, and Custom ShopFlow).

Checkout With CDN

Perform the following tasks to use CDN on the checkout flow for pre-Denali versions of SCA:

  1. Copy the following files from the Reference Checkout folder to the Custom Checkout folder:

    1. index.ssp

    2. cart.ssp

    3. sc.environment.ssp

  2. Rename sc.environment.ssp to checkout.environment.ssp.

  3. Search the following files for all instances of “sc.environment.ssp” and replace them with “checkout.environmnet.ssp”:

    1. index.ssp

    2. cart.ssp

  4. Modify the Custom Checkout SSP Application to point to the following files which you previously copied to the Custom Checkout folder. See Deploy the Migration.

  5. Modify the domain to point to the Custom Checkout SSP Application. See Deploy the Migration.

Related Topics

Secure Shopping Domain (pre-Denali)
Secure Shopping Domains (Elbrus, Vinson, Mont Blanc, and Denali)
Install Your Commerce Website Applications
How to Apply .patch Files

General Notices