/** * @return Mage_Core_Controller_Front_Action|void */ public function preDispatch() { //authenticate $this->authenticate(); if ($this->getRequest()->getActionName() != 'push') { $quoteId = $this->getRequest()->getParam('quote_id', false); //check for quote id param if ($quoteId) { //check if quote exists $quote = Mage::getModel('sales/quote')->load($quoteId); if ($quote->getId()) { Mage::register('current_quote', $quote); //start app emulation $storeId = $quote->getStoreId(); $appEmulation = Mage::getSingleton('core/app_emulation'); $appEmulation->startEnvironmentEmulation($storeId); } else { $message = 'Dynamic : Quote not found: ' . $quoteId; Mage::helper('ddg')->log($message); Mage::helper('ddg')->rayLog('100', $message); } } else { Mage::helper('ddg')->log('Dynamic : order_id missing :' . $quoteId); } } parent::preDispatch(); }
/** * @return Mage_Core_Controller_Front_Action|void */ public function preDispatch() { //authenticate $this->authenticate(); //skip order_id check for this actions $skip = array('push'); $actionName = $this->getRequest()->getActionName(); if (!in_array($actionName, $skip)) { $orderId = $this->getRequest()->getParam('order_id', false); //check for order id param if ($orderId) { //check if order still exists $order = Mage::getModel('sales/order')->load($orderId); if ($order->getId()) { Mage::register('current_order', $order); //start app emulation $storeId = $order->getStoreId(); $appEmulation = Mage::getSingleton('core/app_emulation'); $appEmulation->startEnvironmentEmulation($storeId); } else { $message = 'Dynamic : order not found: ' . $orderId; Mage::helper('ddg')->log($message); } } else { Mage::helper('ddg')->log('Dynamic : order_id missing :' . $orderId); } } parent::preDispatch(); }
/** * @return Mage_Core_Controller_Front_Action|void * @throws Exception */ public function preDispatch() { //authenticate $this->authenticate(); $orderId = $this->getRequest()->getParam('order_id', false); //check for order_id param if ($orderId) { $order = Mage::getModel('sales/order')->load($orderId); //check if the order still exists if ($order->getId()) { Mage::register('current_order', $order); $storeId = $order->getStoreId(); //start the emulation for order store $appEmulation = Mage::getSingleton('core/app_emulation'); $appEmulation->startEnvironmentEmulation($storeId); } else { Mage::helper('ddg')->log('order not found: ' . $orderId); $this->sendResponse(); Mage::throwException(Mage::helper('ddg')->__('Order not found')); } } else { //throw new Exception('TE invoice : order_id missing :' . $orderId); Mage::helper('ddg')->log('order_id missing :' . $orderId); $this->sendResponse(); Mage::throwException(Mage::helper('ddg')->__('Order id is missing')); } parent::preDispatch(); }
/** * @return Mage_Core_Controller_Front_Action|void */ public function preDispatch() { $helper = Mage::helper('ddg'); //authenticate $this->authenticate(); $actionName = $this->getRequest()->getActionName(); switch ($actionName) { case 'score': if (!$helper->getFeefoLogon()) { $this->sendResponse(); return; } break; case 'reviews': if (!$helper->getFeefoLogon() or !Mage::app()->getRequest()->getParam('quote_id')) { $this->sendResponse(); return; } break; } parent::preDispatch(); }
/** * @return Mage_Core_Controller_Front_Action|void */ public function preDispatch() { //authenticate $this->authenticate(); parent::preDispatch(); }