Add New Tab to MyAccount Menu

We can add new tab or menu to the my-account menu tree as shown below.
On clicking the subentry the user will redirect to new page. The View and template of the new page can be set

var myAccountMenu = MyAccountMenu.getInstance();
var pageType = container.getComponent('PageType');

myAccountMenu.addEntry({
	name: Utils.translate('Sub Customers'),
	id: 'subcustomers',
	index: 6
		});

myAccountMenu.addSubEntry({
	entryId: 'subcustomers',
	id: 'sub-customers',
	name: Utils.translate('List of Sub Customers'),
	url: 'sub-customers',
	index: 1
	});
pageType.registerPageType({
	name: 'List of Sub Customers',
	routes: ['sub-customers'],
	view: subcustomerView,
	defaultTemplate: {
	name: 'jj_sub_customer_list_subcustomer.tpl',
	displayName: 'Sub Customer List',
	thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-transaction-list.png')
	  }
		});

Leave a comment

Your email address will not be published. Required fields are marked *