I have been stuck on this task all day. I am hoping someone has some insight or is this a bug? I have tried a few different approaches and nothing seems to actually work.
This is how it currently looks like:
This is how I want it to look like:
Magento_Customer\layout\default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="Magento\Customer\Block\Account\Link" name="my-account-link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">My Account</argument>
<argument name="sortOrder" xsi:type="number">1</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link-top" after="my-account-link">
<arguments>
<argument name="path" xsi:type="string">sales/order/history</argument>
<argument name="label" xsi:type="string" translate="true">My Orders</argument>
<argument name="sortOrder" xsi:type="number">2</argument>
</arguments>
</block>
<block class="Lof\RequestForQuote\Block\Account\Link" name="my-quote-link" after="customer-account-navigation-orders-link-top">
<arguments>
<argument name="label" xsi:type="string" translate="true">My Quotes</argument>
<argument name="sortOrder" xsi:type="number">3</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Html\Link" name="giftr-top-link" after="my-quote-link">
<arguments>
<argument name="path" xsi:type="string">giftr/registry</argument>
<argument name="label" xsi:type="string" translate="true">My Gift Registry</argument>
<argument name="sortOrder" xsi:type="number">4</argument>
</arguments>
</block>
<block class="Magento\Wishlist\Block\Link" name="wish-list-link" after="giftr-top-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">My Wish List</argument>
<argument name="sortOrder" xsi:type="number">5</argument>
</arguments>
</block>
<block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml" after="-">
<arguments>
<argument name="sortOrder" xsi:type="number">6</argument>
</arguments>
</block>
<block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link" template="Magento_Customer::account/link/authorization.phtml" after="-">
<arguments>
<argument name="sortOrder" xsi:type="number">7</argument>
</arguments>
</block>
</referenceBlock>
<block class="Magento\Theme\Block\Html\Header" name="header" as="header">
<arguments>
<argument name="show_part" xsi:type="string">welcome</argument>
</arguments>
</block>
<move element="header" destination="header.links" before="-"/>
<move element="register-link" destination="header.links"/>
<move element="top.links" destination="customer"/>
<move element="my-account-link" destination="top.links" before="-"/>
<move element="customer-account-navigation-orders-link-top" destination="top.links" after="my-account-link"/>
<move element="my-quote-link" destination="top.links" after="customer-account-navigation-orders-link-top"/>
<move element="giftr-top-link" destination="top.links" after="my-quote-link"/>
<move element="wish-list-link" destination="top.links" after="giftr-top-link"/>
<move element="authorization-link" destination="top.links" after="-"/>
</body>
I am also overriding Magento\Customer\Block\Account\Navigation.php
with the changes I found here:
https://github.com/magento/magento2/pull/14726/commits/1a281c1e5fbf8d81b46585df5eb71386b4c03167
Even with those changes I still can't got the top links to be in the order I want. The before
and after
tags do not seem working. So I thought I would try sortOrder
argument but that also doesn't doing anything.