0

I am using a custom reviews form. After submiting the form I want the user to be directed to a new page saying thank you. Currently it is being redirected by the indexcontroller.php with:

$this->_redirectReferer();

How would I get it to redirect to a cms page?

0

3 Answers 3

0
        /* Redirect to certain url  */
        $this->_redirectUrl($url);

if you want to redirect on any page:

        $this->_redirect('pageurl');

For more information follow the blow url: http://blog.chapagain.com.np/magento-redirect-functions/

0

Add a new function in your custom controller:

public function customAction() {
    $this->loadLayout();
    $block = $this->getLayout()->createBlock('core/template')->setTemplate('path/to/custom.phtml');
    $this->getLayout()->getBlock('content')->append($block);
    $this->renderLayout();
}

Then update $this->_redirectReferer(); to $this->_redirect('*/*/custom');

Create your custom page in : app/design/frontend/{package}/{theme}/template/path/to/custom.phtml

<h3>Thanks...<h3>
-1

You can do this by using below code.

$url = Mage::getUrl('thank-you'); --> CMS page url key

$this->_redirectUrl($url);

Not the answer you're looking for? Browse other questions tagged or ask your own question.