Skip to content

Commit 4de94a3

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-3233: Admin can still place order even without payment method
1 parent 58d9f84 commit 4de94a3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,9 @@ protected function _processActionData($action = null)
291291

292292
$this->_getOrderCreateModel()->saveQuote();
293293

294-
if (!($paymentData = $this->getRequest()->getPost('payment'))) {
295-
$paymentData = array('method' => '');
294+
if ($paymentData = $this->getRequest()->getPost('payment')) {
295+
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
296296
}
297-
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
298297

299298
/**
300299
* Saving of giftmessages

app/code/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlock.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public function execute()
9090
$this->storeManager->setCurrentStore($request->getParam('store_id'));
9191
}
9292
try {
93+
if(!$request->getParam('payment')){
94+
$paymentData = array('payment' => array('method' => ''));
95+
$request->setParams($paymentData);
96+
}
9397
$this->_initSession()->_processData();
9498
} catch (\Magento\Framework\Exception\LocalizedException $e) {
9599
$this->_reloadQuote();

0 commit comments

Comments
 (0)