隐藏和跳过运输,在后端的magento付款方式

时间:2012-03-21 07:38:04

标签: magento

我想

  • Hide执行以下操作
  • skip运费,后端magento中的付款方式方法

我试过了 覆盖' Mage / Adminhtml / controllers / Sales / Order / CreateController.php' saveaction(),默认运费和付款方式值如下:

public function saveAction()
    {
      try {
            $this->_processData();
            if ($paymentData = $this->getRequest()->getPost('payment')) {
                $this->_getOrderCreateModel()->setPaymentData($paymentData);
                $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
            }

            $order = $this->_getOrderCreateModel()
                ->importPostData($this->getRequest()->getPost('order'))
//------------edit start
                    ->setPaymentMethod('checkmo')
                    ->setShippingMethod('freeshipping_freeshipping')
//------------edit end
                ->createOrder();

            $this->_getSession()->clear();
            Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));
            $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
        }
        catch (Mage_Core_Exception $e){
            $message = $e->getMessage();
            if( !empty($message) ) {
                $this->_getSession()->addError($message);
            }
            $this->_redirect('*/*/');
        }
        catch (Exception $e){
            $this->_getSession()->addException($e, $this->__('Order saving error: %s', $e->getMessage()));
            $this->_redirect('*/*/');
        }
    }

0 个答案:

没有答案