Monday, April 4, 2011

If else condition in mini.login.phtml on magento

I had this problem with the mini.login.phtml on magento 1.4.0.1, the case was when I try to successfully login to the front page, the Email and Password Boxes are still visible to I tried to replace it with other options once the user has successfully logged in. Since I need to display the "My account". "Logout"..etc Options after a successful login. I made a conditional statement. And here's the code. Credits to Mr. Michael Christian Young for giving an Idea about this. Though, there was a little bit of a bug on the code he gave me to I had to organize and re assemble them.

Anyways, here it is.


/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
helper('customer')->isLoggedIn()): ?>










Hope that helps to those people facing the same problem as I once had. :)

Cheers,
spawn

No comments:

Post a Comment