Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Get Username
 
betabomber
Member
 
Avatar
Total Posts:  37
Joined:  2008-02-22
 

I’m setting up a redirect page that automatically sends the user to a CMS page that has a status report on a current order.

Right now, I have a CMS page that uses a layout that redirects the user via a meta redirect.

How do I grab the user name variable with php to dynamically change the page the user is redirected to?

 
Magento Community Magento Community
Magento Community
Magento Community
 
betabomber
Member
 
Avatar
Total Posts:  37
Joined:  2008-02-22
 

OK, so I made a page that redirects the user to a CMS page associated to their email address:

<meta http-equiv="REFRESH" content="0;
    <?php 
        if (Mage::getSingleton('customer/session')->isLoggedIn()) { 
            
$this->__(Mage::getSingleton('customer/session')->getCustomer()->getEmail()); 
        } else { 
            echo 'customer/account/login/'; } 
    ?>
"
>

If a user is not logged in, as expected, the page is redirected to the login screen, but the

$this->__(Mage::getSingleton('customer/session')->getCustomer()->getEmail());
won’t work unless it is in the header.phtml. The page keeps redirecting to itself because the above code does not return anything.

What did I do wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
betabomber
Member
 
Avatar
Total Posts:  37
Joined:  2008-02-22
 

Still scratching my head on this one. Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top