示例#1
0
 /**
  * Update shipping method (combined action for ajax and regular request)
  */
 public function saveShippingMethodAction()
 {
     try {
         $isAjax = $this->getRequest()->getParam('isAjax');
         $this->_initCheckout();
         $this->_checkout->updateShippingMethod($this->getRequest()->getParam('shipping_method'));
         if ($isAjax) {
             $this->loadLayout('paypal_express_review_details');
             $this->getResponse()->setBody($this->getLayout()->getBlock('root')->setQuote($this->_getQuote())->toHtml());
             return;
         }
     } catch (Mage_Core_Exception $e) {
         $this->_getSession()->addError($e->getMessage());
     } catch (Exception $e) {
         $this->_getSession()->addError($this->__('Unable to update shipping method.'));
         Mage::logException($e);
     }
     if ($isAjax) {
         $this->getResponse()->setBody('<script type="text/javascript">window.location.href = ' . Mage::getUrl('*/*/review') . ';</script>');
     } else {
         $this->_redirect('*/*/review');
     }
 }
示例#2
0
 /**
  * Set shipping method to quote, if needed
  * @param string $methodCode
  */
 public function updateShippingMethod($methodCode)
 {
     parent::updateShippingMethod($methodCode);
     $this->_quote->save();
 }