Apply the Patch to Source Files

To leverage a secure shopping domain in your pre-Denali implementation of Site Builder, you need to introduce these changes as custom files and deploy to your Custom implementation.

This patch is highly technical and involves customizing multiple files. Before you begin making changes, back up any custom files that already exist. Each .zip file listed in the procedure below includes a .patch file for a specific implementation. Launch the .patch file and introduce changes manually.

For each file that needs updating, go to the SSP Application in NetSuite and copy the Reference files to the same location in the Custom folder:

Documents > Files > File Cabinet > Web Site Hosting Files > Live Hosting Files > SSP Applications

To implement the patch:

  1. Download the correct patch .zip file, depending on you implementation.

    These files include all changes described in this procedure:

    Implementation

    Download

    Site Builder Reference Checkout 2.0.4 and 2.0.5

    HTTPS_SiteBuilder-Reference-Checkout-2-0-4_and_2-0-5.zip

    Site Builder Reference My Account and My Account Premium 1.0.5

    HTTPS_SiteBuilder-Reference-My-Account.1-0-5.zip

    Site Builder Reference My Account and My Account Premium 1.0.6

    HTTPS_SiteBuilder-Reference-My-Account-1-0-6.zip

  2. Extract the .zip file and open the .patch file you find there.

    The .patch file describes each file and subsequent code to be customized.

  3. If your implementation includes previous customizations, ensure that each file being patched is located in the custom folder and downloaded to your local environment.

  4. If your implementation does not include any previous customizations, perform the following steps:

    1. Copy the corresponding source file located in the Reference implementation in NetSuite.

      If a preexisting file exists in the Custom implementation, then a customization has already been implemented on that file in the past. Back up this file and customize it instead.

    2. Create a local copy for development.

  5. Access the root of your local development environment for this implementation.

  6. Manually modify your files as instructed in the patch files to add or remove lines, as required.

    See How to Apply .patch Files for instructions on how to understand .patch files and apply changes. The following example describes one scenario.

    When you have successfully uploaded your customizations, continue with the next step: Deploy Files and Configure the Implementation.

Patch Update Example

The following code snippet comes from the Site Builder Reference Checkout 2.0.4 .patch file:

          diff --git a/index-local.ssp b/index-local.ssp
index 3f974de..ac20076 100644
--- a/index-local.ssp
+++ b/index-local.ssp
@@ -30,11 +30,11 @@
          login = true;
       }
       else if (
-               (SiteSettings.registration.registrationoptional !== 'T' && !session.isLoggedIn())
-            ||   (!SC.Configuration.checkout_skip_login && !session.isLoggedIn())
-            ||   (parameters.is && (parameters.is === 'login' || parameters.is === 'register') && !session.isLoggedIn())
+               (SiteSettings.registration.registrationoptional !== 'T' && !session.isLoggedIn2())
+            ||   (!SC.Configuration.checkout_skip_login && !session.isLoggedIn2())
+            ||   (parameters.is && (parameters.is === 'login' || parameters.is === 'register') && !session.isLoggedIn2())
             ||   (parameters.is && (parameters.is === 'login' || parameters.is === 'register') && session.getCustomer().isGuest())
-            ||   (SC.Configuration.checkout_skip_login && !session.isLoggedIn() && session.isRecognized())
+            ||   (SC.Configuration.checkout_skip_login && !session.isLoggedIn2() && session.isRecognized())
             )
       {
          delete parameters.sitepath; 

        

In this example, these lines specify that the file you need to customize is index-local.ssp:

          diff --git a/index-local.ssp b/index-local.ssp 

        

The next lines in the example provide a reference point to locate the code in the file that needs updated. Two sets of @@ symbols specify that the code to be customized is located on line 30 of the file and that 11 lines of code are displayed. The code after this line reference provides a reference to help locate the area in the file affected by this change:

          @@ -30,11 +30,11 @@
          login = true;
       }
       else if ( 

        
Important:

The line reference (@@) specifies the line in the original source code. If you have made any preexisting modifications to the file prior to this patch, the code needing customized code may be located on a different line.

Any lines prepended with a symbol indicate code to delete/remove as part of this patch. In this example, you remove the following lines from index-local.ssp:

          -               (SiteSettings.registration.registrationoptional !== 'T' && !session.isLoggedIn())
-            ||   (!SC.Configuration.checkout_skip_login && !session.isLoggedIn())
-            ||   (parameters.is && (parameters.is === 'login' || parameters.is === 'register') && !session.isLoggedIn()) 

        

Lines prepended with a + symbol indicate code to add:

          +               (SiteSettings.registration.registrationoptional !== 'T' && !session.isLoggedIn2())
+            ||   (!SC.Configuration.checkout_skip_login && !session.isLoggedIn2())
+            ||   (parameters.is && (parameters.is === 'login' || parameters.is === 'register') && !session.isLoggedIn2()) 

        

Lines not prepended with a or + symbol do not require change. See How to Apply .patch Files for more information on how to apply these changes manually.

Related Topics

General Notices