Скрыть и пропустить доставку, способ оплаты в magento в бэкэнде - PullRequest
0 голосов
/ 21 марта 2012

Я хочу

  • Hide сделать следующее
  • и skip доставка, способ оплаты в magento in backend

Я пытался Перезаписано «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('*/*/');
        }
    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...