Magento seems to include the “Login” link by default. However, Magento does not seem to show a link to Logout after one logs in.
If you have been searching tirelessly for a solution to your Magento
logout woes, have no worries your search is at an end! We’ve already
searched and found. We’ve included the code you will need to add a
Logout link to Magento. This code actually
only displays the pertinent link – so if a user is already logged in
they will only see a Logout link and if a user is not Logged in then
they will see a Login link.
Here is the code:
<?php if (! Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<a href="<?php echo Mage::helper('customer')->getLoginUrl(); ?>"><?php echo $this->__('Login') ?></a>
<?php else: ?>
<a href="<?php echo Mage::helper('customer')->getLogoutUrl(); ?>"><?php echo $this->__('Logout') ?></a>
<?php endif; ?>
So there you have it, a way to add a Logout link to Magento!
来源:http://www.webnuggs.com/magento/magento-help/adding-a-logout-link-to-magento
分享到:
相关推荐
magento程序添加多个表运费,可以自行设置运费计算公式
如何给产品描述里的关键字、字词批量添加链接?我想大家一直在的这样的插件。说实话,我也找了很久,也没有找到。可是由于需要,不得不自己开发一个这样的插件。并支持到Magento1.6.2 说明请查看:...
You’ll start by getting a general understanding of what Magento is, why and how you should use it, and whether it is possible and feasible to migrate from an old web store to Magento 2. As you work ...
magento入门原版书.。。The Definitive Guide to Magento.pdf
Chapter 6, Creating a Magento 2 Theme, discusses the Magento 2 blank theme and how to use the fallback to create seasonal variations. It also explains how the new theme is set up and where files are ...
Apress.The.Definitive.Guide.to.Magento.Dec.2009.pdf Apress于2009重磅推出的Magento上手书籍,原书地址:http://www.apress.com/book/view/9781430272298
NULL 博文链接:https://hudeyong926.iteye.com/blog/1608792
magento数据结构分析 magento数据字典
NULL 博文链接:https://hudeyong926.iteye.com/blog/1728074
Get a hands-on introduction to custom shipping and payment methods ☆ 出版信息:☆ [作者信息] Branko Ajzele [出版机构] Packt Publishing [出版日期] 2013年09月25日 [图书页数] 128页 [图书语言] 英语...
magento的SMTP插件magento的SMTP插件magento的SMTP插件
Chapter 6, Creating a Magento 2 Theme, discusses the Magento 2 blank theme and how to use the fallback to create seasonal variations. It also explains how the new theme is set up and where files are ...
magik shoes magento 模板, magento 1.7 模板
Magento插件开发手册 Magento Extension Developers Guide
深入理解Magento 由精东博客下载下来制作成pdf
Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全自定义,一键安装演示,小工具化横幅系统,颜色选择,MEGA菜单,多商店支持,自定义产品...
主要包括的内容有:magento的常用设置、Magento模板制作教程、Magento商城_目录结构说明、Magento中文教程实用文档、常用的xml的文件的作用以及自定义模块的应用
magento2 developers cookbook, magento 开发手册,magento教程
magento 积分插件 magento 积分插件 magento 积分插件