Apply Patch to Source Files

This topic applies to

Applies to

Site Builder

Apply the changes in this patch using the Override method, as described in this section. The following table lists the files to be overridden and their locations in the Vinson source code, where X.Y.Z represents the version of the module in your implementation:

Module

Subdirectory

File

CheckoutApplication@X.Y.Z

/Internal

/index-local.ssp

/JavaScript

/SC.Checkout.Configuration.js

/SuiteScript

/checkout.environment.ssp

/SuiteScript/checkout.ssp

CheckoutSkipLogin@X.Y.Z

/JavaScript

/CheckoutSkipLogin.js

GoogleUniversalAnalytics@X.Y.Z

/JavaScript

/GoogleUniversalAnalytics.js

LiveOrder@X.Y.Z

/SuiteScript

/LiveOrder.Model.js

MyAccountApplication@X.Y.Z

/Internal

/index-local.ssp

/SuiteScript

/my_account.ssp

/SuiteScript

/myaccount.environment.ssp

NavigationHelper@X.Y.Z

/JavaScript

/NavigationHelper.Plugins.DataTouchPoint.js

ProductList@X.Y.Z

/SuiteScript

/ProductList.Model.js

Profile@X.Y.Z

/SuiteScript

/ProductList.Model.js

/Profile.Model.js

SiteSettings@X.Y.Z

/SuiteScript

/SiteSettings.Model.js

SspLibraries@X.Y.Z

/SuiteScript

/Application.js

/ServiceController.Validations.js

/Utils.js

Utilities@X.Y.Z

/JavaScript

/Utils.js

jQueryExtras@X.Y.Z

/JavaScript

/jQuery.ajaxSetup.js

/JavaScript

/jQuery.ajaxSetup.noLoader.js

Note

In general, NetSuite best practice is to extend JavaScript using the JavaScript prototype object. This improves the chances that your customizations continue to work when migrating to a newer version of SuiteCommerce Advanced. However, this patch requires you to modify files in a way that you cannot extend, and therefore requires you to use a custom module to override the existing module file. For more information, see Customize and Extend Core SuiteCommerce Advanced Modules.


Create Override Files

The first step is to create a space to contain your customized files. You set up your new files to override the existing code when you deploy to NetSuite.

To create override files:

  1. Open the Modules directory and create a subdirectory titled extensions to maintain your customizations.

  2. In your extensions directory, create a new directory for each module according to the table above. Give these new modules a version of 1.0.0.

    For example:

    Modules/extensions/CheckoutApplication@1.0.0/

    Modules/extensions/CheckoutSkipLogin@1.0.0/

    Modules/extensions/GoogleUniversalAnalytics@1.0.0/

    ...

  3. In each new module directory, create the required subdirectories according to the table above.

    For example, the directory structure for your custom CheckoutApplication@1.0.0 module should look similar to the following:

    Modules/extensions/CheckoutApplication@1.0.0
          /Internal
          /JavaScript
          /SuiteScript
  4. Locate the files in your current implementation to be overridden according to the table.

  5. Make a copy of each file and paste the copy into the applicable subdirectory.

    For example, your directory structure for your custom CheckoutApplication@1.0.0 module should look similar to the following:

    Modules/extensions/CheckoutApplication@1.0.0/
          Internal/
             index-local.ssp
          JavaScript/
             SC.Checkout.Configuration.js
          SuiteScript/
              checkout.environment.ssp
  6. Repeat this procedure for each file you need to override.

Implement the Patch Changes

The next step is to implement the patch in each new override file.

To implement the patch:

  1. Download the .patch file associated with this patch guide here: HTTPS_SiteBuilder-Vinson.zip.

    This file includes all changes described in this procedure.

  2. Open each new file within your extensions directory and add or remove lines (as applicable) according to the .patch file.

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

Example

The following code snippet comes from the Vinson Site Builder Extensions Premium .patch file:

... diff --git a/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js b/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js index 48cd87d..8dbc7eb 100644 --- a/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js +++ b/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js @@ -62,15 +62,15 @@ define( ,*/ - currentTouchpoint: _.isSecureDomain() ? 'checkout' : 'viewcart' + currentTouchpoint: Utils.isInShopping() ? 'viewcart' : 'checkout' , modulesConfig: { 'ItemDetails': {startRouter: true} ...

In this example, these lines specify that the file you need to customize is SC.Checkout.Configuration.js:

diff --git a/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js b/Modules/suitecommerce/CheckoutApplication@2.2.0/JavaScript/SC.Checkout.Configuration.js

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 62 of the file and that 15 lines of code are displayed. The code after this reference is included as a visual reference to help locate the code affected by this change:

@@ -62,15 +62,15 @@ define( ,*/

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 line from SC.Checkout.Configuration.js:

- currentTouchpoint: _.isSecureDomain() ? 'checkout' : 'viewcart'

Lines prepended with a + symbol indicate code to add. In this example, you add the following line:

+ currentTouchpoint: Utils.isInShopping() ? 'viewcart' : 'checkout'

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.