I want to add a button to abc.com/customer/account
page when the user click it, it will redirect to a new page e.g. customer/account/upgrademember
. How can I do this? I find it difficult to route it to my module. In Magento_Customer
module, the \Magento\Customer\etc\frontend\route.xml
defines when the frontName is customer, Magento will go to Magento_Customer
module. But I create a new Controller upgrademember.php
in my module. How can the Magento go to my upgrademember.php
when the user clicks the abc.com/ccustomer/account/upgrademember
.?
Magento – Magento 2 how to extend core module
controllersextendmagento2
Best Answer
Finally, I got another solution. It is adding
routes.xml
underetc/frontend
It will redirect the upgrade
abc.com/ccustomer/account/upgrademember
to the my custom module's controllerUpgradeMember.php