1

I am trying to re-order customer account navigation links.

enter image description here

And I have tried out the below 2 approaches:

  1. Using move

File Path: \design\frontend\DasLeben\porto\Magento_Customer\layout\customer_account.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="customer-account-navigation-downloadable-products-link" remove="true" />
     <move element="customer-account-navigation-my-designs" destination="customer_account_navigation" after="customer-account-navigation-orders-link" />
     <move element="customer-account-navigation-mycard" destination="customer_account_navigation" after="customer-account-navigation-my-designs" />
     <move element="customer-account-navigation-my-saved-cards" destination="customer_account_navigation" after="customer-account-navigation-mycard" />
     <move element="customer-account-navigation-address-link" destination="customer_account_navigation" after="customer-account-navigation-my-designs" />
</body>
</page>                                     

I have even tried adding the move attributes in the corresponding link definition classes in customer_account.xml, but it doesn't work.

  1. Using sortOrder
<?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="customer_account_navigation">
      <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-designs-link">
        <arguments>
          <argument name="path" xsi:type="string">my-designs</argument>
          <argument name="label" xsi:type="string">My Current Designs</argument>
          <argument name="sortOrder" xsi:type="number">210</argument>
        </arguments>
      </block>
    </referenceBlock>
  </body>
</page>

Both the approaches have no effect on the link account in customer account. What am i doing wrong?

0

Update customer_account.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-custom">
                <arguments>
                    <argument name="path" xsi:type="string">contact</argument>
                    <argument name="label" xsi:type="string">My Current Designs</argument>
                </arguments>
        </block>
        </referenceBlock>
    </body>
</page>

please put your path correct

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.