Magento Forum

   
Page redirect
 
tobeyt23
Member
 
Avatar
Total Posts:  47
Joined:  2008-11-04
Ocean City, Maryland
 

This doesn’t seem, to work:

Mage::getSingleton('core/controller')->_redirectReferer('index.php');

any suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Where are you making this call?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tobeyt23
Member
 
Avatar
Total Posts:  47
Joined:  2008-11-04
Ocean City, Maryland
 

In form i created ... basically if something isn’t set when they load the page i want it to redirect

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Ah ok, but is it made from the frontend or the backend? Could you perhaps provide the file path?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tobeyt23
Member
 
Avatar
Total Posts:  47
Joined:  2008-11-04
Ocean City, Maryland
 

it is the front end /default/default/template/page/distributors.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Easy way
Make a javascript to submit the form, then using

// Remove the space between window. location! (Can't be posted without the space on this forum)
windowlocation.href '<?php Mage::getUrl('*/'); ?>';

Advanced way
Set your block to extend Mage_Core_Controller_Varien_Action, then use the following to redirect a user.

$this->_redirect('index');

The later one can be hard to implant, see usually only controllers make redirection calls. So I suggest you use the javascript solution.

One of those should work. Can’t guarantee it though, but at least that should point you in the right direction ^_^

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