I have a requirement that the logout url must be visible only in My Account bottom for every section of it like on "Account Information","Address Book", "My Orders" similar for all.
How to do this?
Where should I write
action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
in My customer.xml
file.
You can remove the block 'customer_logged_in' in customer.xml and then you can add/make a block in customer.xml like this.
<reference name="content">
<block type="page/html_wrapper" name="my.account.wrapper" translate="label">
<label>My Account Wrapper</label>
<action method="setElementClass"><value>my-account</value></action>
<block type="core/template" name="logout_link" template="customer/logout_link.phtml"/>
</block>
</reference>
And the content of the logout_link.phtml would be something like,
<?php
$loggedIn = $this->helper("customer")->isLoggedIn();
if($loggedIn == 1){
echo "<a href=\"".Mage::getBaseUrl()."customer/account/logout/\" >LOGOUT</a>";
}else{
echo "<a href=\"".Mage::getBaseUrl()."customer/account/\" >LOGIN</a>";
}?>
....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With