1)First of all creating an extension
2)Take the entry point file of the extension[JJ.extncheck.MyCoolModule.js]
define(
'JJ.extncheck.MyCoolModule'
, [
'JJ.extncheck.MyCoolModule.View'
,'JJ.extncheck.MyCoolModule.Router'
]
, function (
MyCoolModuleView
,mycoolmodulerouter
)
{
'use strict';
return {
mountToApp: function mountToApp (container)
{
// using the 'Layout' component we add a new child view inside the 'Header' existing view
// (there will be a DOM element with the HTML attribute data-view="Header.Logo")
// more documentation of the Extensibility API in
// https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/index.html
/** @type {LayoutComponent} */
var myaccountmenu = container.getComponent('MyAccountMenu');
var preordersmenugroup = {
id: "Downloads",
name: "Customer Notification",
index: 6,
url: "update-terms-and-conditions",
permissionoperator: "OR",
permission: [
{
group: "transactions",
id: "tranSalesOrd",
level: "1"
},
{
group: "transactions",
id: "tranEstimate",
level: "1"
}
]
}
myaccountmenu.addGroup(preordersmenugroup);
}
};
});
3)In view file comment the unwanted module file[MyCoolModule.View.js]
// @module JJ.extncheck.MyCoolModule
define('JJ.extncheck.MyCoolModule.View'
, [
'jj_extncheck_mycoolmodule.tpl'
//, 'JJ.extncheck.MyCoolModule.SS2Model'
, 'Backbone'
]
, function (
jj_extncheck_mycoolmodule_tpl
//, MyCoolModuleSS2Model
, Backbone
)
{
'use strict';
// @class JJ.extncheck.MyCoolModule.View @extends Backbone.View
return Backbone.View.extend({
template: jj_extncheck_mycoolmodule_tpl
, initialize: function (options) {
/* Uncomment to test backend communication with an example service
(you'll need to deploy and activate the extension first)
*/
// this.model = new MyCoolModuleModel();
// var self = this;
// this.model.fetch().done(function(result) {
// self.message = result.message;
// self.render();
// });
}
, events: {
}
, bindings: {
}
, childViews: {
}
//@method getContext @return JJ.extncheck.MyCoolModule.View.Context
, getContext: function getContext()
{
//@class JJ.extncheck.MyCoolModule.View.Context
this.message = this.message || 'Hello World!!'
return {
message: this.message
};
}
});
});
4)Using command “gulp extension:local” and “gulp extension:deploy”
5)Activate the domain and the change will be present in the domain