How to reorder my account sidebar nav link in Magento2
- ACCOUNT DASHBOARD
- MY ORDERS
- ADDRESS BOOK
- ACCOUNT INFORMATION
- MY PRODUCT REVIEWS
- NEWSLETTER SUBSCRIPTIONS
How to Re arrange the nav
links.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWe can rearrange these links by using the "move" element in your layout file (customer_account.xml).
File path, if you are working in your custom theme: app/design/frontend/{vendor}/{themename}/Magento_Customer/layout/customer_account.xml
OR
File path, if you are working in your custom module:
app/code/{Vendor}/{Module}/view/frontend/layout/customer_account.xml
Code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="customer-account-navigation-account-edit-link" destination="customer_account_navigation" before="-"/>
<move element="customer-account-navigation-orders-link" destination="customer_account_navigation" after="customer-account-navigation-account-edit-link"/>
</body>
</page>
And the same with remain links you would like to sort. "customer-account-navigation-account-edit-link", "customer-account-navigation-orders-link" is the block name in layout, with the help of "before" and "after" element.