Need to rename the standard header menu and my account menu tabs name using extension
Create the extension normal way. In the entry point we need to extend the views. In our case Menutreeview and Header menu myaccount menu.
Compare each children and if the id matches get the tab need to rename and rename it
_.extend(HeaderMenuMyAccountView.prototype, {
getContext: _.wrap(HeaderMenuMyAccountView.prototype.getContext, function (fn) {
var original_Ret = fn.apply(this, _.toArray(arguments).slice(1));
// console.log('original_Ret', original_Ret)
try{
_.each(original_Ret.entries, function (line) {
_.each(line.children, function (children) {
if (children.id == "productlist_all") {
var menuitems = line.children;
var allmyListindex = _.findIndex(menuitems,
function (num) {
return num.id == "productlist_all";
});
menuitems[allmyListindex].name = "All my order forms";
var myListindex = _.findIndex(menuitems,
function (num) {
return num.id == "productlist_8";
});
var changemyListname = menuitems[myListindex].name;
var newmyList = changemyListname.replaceAll('My list ', 'My order Form ');
menuitems[myListindex].name = newmyList;
}
})
})
}
catch (e) {
console.log("err@headermenutreeView", e);
}
return original_Ret
})
});