Magento 1.7 *: How to add the "Exit" link in the sidebar of my account

I would like to add the "logout" link to the Magento store that I am developing.

On the "My Account" page, the left side panel under all the links (last link below):

  • User account
  • Account Information
  • The address book
  • Etc.

How to add a link below?

I think I should add a line of code to customer.xml.

I think this should be in this block:

<block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml"> <action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action> <action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action> <action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action> </block> 

And something on the line:

 <action method="addLink" translate="label" module="customer"><name>LOGOUT</name><path>LOGOUT_PATH</path><label>Logout</label></action> 

I just don’t know what kind of code should be.

Thank you in advance for your help.

+4
source share
2 answers

Ignore what I understood.

The code was:

 <action method="addLink" translate="label" module="customer"><name>logout</name><path>customer/account/logout/</path><label>Log out</label></action> 
+1
source

While your solution works, it is considered best practice to make all layout changes to the app/design/frontend/your_package/your_theme/layout/local.xml and refrain from directly editing other layout files.

For this change, your local.xml file will look like this:

 <?xml version="1.0"?> <layout version="0.1.0"> <customer_account> <reference name="left"> <reference name="customer_account_navigation"> <action method="addLink" translate="label" module="customer"> <name>logout</name> <path>customer/account/logout/</path> <label>Log Out</label> </action> </reference> </reference> </customer_account> </layout> 

local.xml Link

A good resource to start using local.xml is on this page:
Classy Llama The Best Way to Change Magento's Layout

An article will be better without wrapping words, but they cover most of the editing tools for your layout.

+8
source

Source: https://habr.com/ru/post/1497944/


All Articles