How can I remove a menu item from the My Account n...
# suitecommerce
k
How can I remove a menu item from the My Account nav? In a post on March 10, @Bryce mentioned he did it via
MyAccountMenu.removeSubEntry('balance');
but
removeSubEntry
isn't a function of MyAccountMenu, so I don't understand how he supposedly accomplished that. Only functions are
addGroup
and
addGroupEntry
. On 2019.2. Thoughts?
b
Correct the
MyAccountMenu.Component
only has those 2, but if you look at the actual
MyAccountMenu
you can see all the others. Located in
/Advanced/Header/JavaScript/MyAccountMenu
k
Ah, I see! Could you help explain how I'd use an instance of that - is that something I can use in an extension?
b
Yes, this is what I did to remove the balance menu item :
Copy code
var myaccountmenu = MyAccountMenu.MyAccountMenu.getInstance();
        myaccountmenu.removeSubEntry('balance');
k
So are you pulling in MyAccountMenu in the define statement at the top of your extension? What does that look like? (Thanks so much for the help, I'm new to SCA - sorry for these basic questions)
b
No problem, yes I just pull it in like any other module
'MyAccountMenu'
k
ah, great! Wasn't sure of the syntax of that. It's working. Thanks so much for the assistance.
👍 1