0

How can I add the Logout link in Customer My Account using the authorization-link in the body of ../Magento_Customer/layout/customer_account.xml?

I want to add this block:

to customer_account.xml to show logout link in my account, in main column of this view, the bottom of all

2 Answers 2

2

you can try this to add a tab in the customer account:

        <block class="Magento\Customer\Block\Account\SortLinkInterface" name="name of the block">
            <arguments>
                <argument name="path" xsi:type="string">your path eg: abc/abc</argument>
                <argument name="label" xsi:type="string" translate="true">name of the tab</argument>
                <argument name="sortOrder" xsi:type="number">52</argument>
            </arguments>
        </block>
1

You can add the Logout link by adding below block in your customer_account.xml file after all links.

<referenceBlock name="customer_account_navigation">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="demo-link">
        <arguments>
            <argument name="path" xsi:type="string">customer/account/logout</argument>
            <argument name="label" xsi:type="string">LogOut</argument>
            <argument name="sortOrder" xsi:type="number">1000</argument>
        </arguments>
    </block>
</referenceBlock>

Hope it helps!!!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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