To implement this patch, create a custom module to override the OrderWizard.Module.ShowShipments.js file, which ispart of the OrderWizard.Module.Shipmethod@X.Y.Z module. In this example, X.Y.Z represents the version of the OrderWizard.Module.Shipment module in your implementation of SuiteCommerce Advanced. You can download the code samples described in this procedure here:
Step 1: Create the Override File
- Create an extensions directory to store your custom module. Depending on your implementation, this directory might already exist. For example, create
Modules/extensions - Within this directory, create a custom module with a name similar to the module being customized.For example, create
Modules/extensions/OrderWizard.Module.Shipmethod.Extension@1.0.0. - In your new StoreLocator.Extension@1.0.0 directory, create a subdirectory called
JavaScript.For example:Modules/extensions/OrderWizard.Module.Shipmethod.Extension@1.0.0/JavaScript - Copy the following source file and paste into the correct location:Copy This File:Place a Copy Here:Modules/suitecommerce/OrderWizard.Module.Shipment@X.Y.Z/OrderWizard.Module.ShowShipments.jsModules/extensions/OrderWizard.Module.Shipmethod.Extension@1.0.0/JavaScriptIn this example, X.Y.Z represents the version of the module in your implementation of SuiteCommerce Advanced.
- Revise your new OrderWizard.Module.ShowShipments.js file following these steps:
- Replace the existing
initializefunction with this code:
- Replace the existing
, initialize: function ()
{
WizardModule.prototype.initialize.apply(this, arguments);
this.application = this.wizard.application;
this.options.application = this.wizard.application;
this.addressSource = this.options.useModelAddresses ?
this.model.get('addresses') : this.wizard.options.profile.get('addresses');
BackboneCompositeView.add(this);
this.wizard.model.on('ismultishiptoUpdated', this.render, this);
this.wizard.model.on('promocodeUpdated', this.render, this);
this.address = this.addressSource.get(this.model.get('shipaddress'));
this.address && this.address.on('change', this.render, this);
}
Add this new destroy function after the initialize function:
, destroy: function destroy()
{
this.address && this.address.off('change', this.render, this);
return this._destroy();
}
Save the file.
Step 2: Prepare the Developer Tools For Your Customization
Open your Modules/extensions/StoreLocator.Extension@1.0.0 module directory.
Create a file in this directory and name it ns.package.json.
Modules/extensions/OrderWizard.Module.Shipmethod.Extension@1.0.0/ns.package.json
Paste the following code in your new ns.package.json file:
{
"gulp": {
"javascript": [
"JavaScript/*.js"
]
},
"overrides": {
"suitecommerce/OrderWizard.Module.Shipmethod@X.Y.Z/JavaScript/OrderWizard.Module.ShowShipments.js": "JavaScript/OrderWizard.Module.ShowShipments.js"
}
}
Open the distro.json file. This file is located in your root directory.
Add your custom module to the modules object.
Your code should look similar to the following example:
{
"name": "SuiteCommerce Advanced Aconcagua",
"version": "2.0",
"isSCA": true,
"buildToolsVersion": "sc0-2018.1.0",
"folders": {
"modules": "Modules",
"suitecommerceModules": "Modules/suitecommerce",
"extensionsModules": "Modules/extensions",
"thirdPartyModules": "Modules/third_parties",
"distribution": "LocalDistribution",
"deploy": "DeployDistribution"
},
"modules": {
"extensions/OrderWizard.Module.Shipmethod.Extension": "1.0.0",
"suitecommerce/Account": "sc0-2018.1.0",
...
This ensures that the Gulp tasks include your module when you deploy. In this example, the custom modules are added at the beginning of the list of modules. However, you can add the modules anywhere in the modules object. The order of precedence in this list does not matter.
Save the distro.json file.
Step 3: Test and Deploy Your Customization
Confirm your results.
Upon successful deployment, edited shipping address information displays on the Review Your Order page.