Skip to content

Commit f0c6ecb

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

File tree

2 files changed

+5
-9
lines changed
  • app/code/Magento/Sales

2 files changed

+5
-9
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ protected function _processActionData($action = null)
280280

281281
if ($paymentData = $this->getRequest()->getPost('payment')) {
282282
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
283+
} else {
284+
$this->_getOrderCreateModel()->getQuote()->getPayment()->setMethod('');
283285
}
284286

285287
$eventData = [
@@ -293,6 +295,8 @@ protected function _processActionData($action = null)
293295

294296
if ($paymentData = $this->getRequest()->getPost('payment')) {
295297
$this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentData);
298+
} else {
299+
$this->_getOrderCreateModel()->getQuote()->getPayment()->setMethod('');
296300
}
297301

298302
/**

app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,5 @@ script;
9292
<?= /* @noEscape */
9393
$secureRenderer->renderTag('script', [], $scriptString, false) ?>
9494
<?php else: ?>
95-
<div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?>
96-
<span class="no-display">
97-
<input id="p_method"
98-
value="<?= $escaper->escapeHtmlAttr(''); ?>"
99-
type="text"
100-
name="payment[method]" class="admin__control-radio"
101-
checked="checked"/>
102-
</span>
103-
</div>
95+
<div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?></div>
10496
<?php endif; ?>

0 commit comments

Comments
 (0)