Magento – Magento call another action with parameters

actioncontrollersredirect

While placing order I'm calling my custom saveOrderAction() where I'm saving order data.

Inside saveOrderAction(), I'm trying to call redirectAction() method where I want to fetch order information and redirect to paytm for payment.

Inside saveOrderAction() I've

  // redirectAction Call
                    if($response){
                        $this->_forward($action = 'redirectAction',
                            $controller = 'zigycheckout_index',
                            $module = 'Medex_ZigyCheckout',
                            $params = array('quote' => $checkoutSession->getQuote()));
                    }

which is not redirecting to redirectAction().
Also how I can fetch data in redirectAction() sent from saveOrderAction()? using $order_id = $this->getRequest()->getPost('quote'); ?

Best Answer

Please try to do this way

$parameters =array('test1'=>'data1','test2'=>'data2');
$this->_forward('redirect',NULL,NULL,$parameters);


public function redirectAction()
{
    $first_data = $this->getRequest()->getParam('test1');
    $second_data = $this->getRequest()->getParam('test2');
    .........More Code.........
}

Thanks.