Skip to content

Commit 20d3301

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

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

app/code/Magento/Payment/Plugin/AdminSetPaymentMethod.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ public function __construct(
3535
*/
3636
public function beforeImportPostData(Create $subject, array $data)
3737
{
38-
if (!isset($data['payment_method'])
39-
&& ($_POST)
40-
&& !isset($this->request->getParam('payment')['method'])) {
38+
if (isset($this->request->getParam('payment')['method'])) {
4139
$subject->setPaymentMethod('');
4240
}
4341
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,13 @@ script;
9292
<?= /* @noEscape */
9393
$secureRenderer->renderTag('script', [], $scriptString, false) ?>
9494
<?php else: ?>
95-
<div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?></div>
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>
96104
<?php endif; ?>

0 commit comments

Comments
 (0)