`
天梯梦
  • 浏览: 13640580 次
  • 性别: Icon_minigender_2
  • 来自: 洛杉矶
社区版块
存档分类
最新评论

magento 添加退出链接 Adding a Logout Link to Magento

 
阅读更多

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

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics