Skip to content

Commit 16e962d

Browse files
committed
#30255: Fixed The coupon code has been accepted. message remains after a Coupon Code was removed
reverted previous changes and updated requested changes
1 parent f54561e commit 16e962d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ protected function _processActionData($action = null)
344344
$this->messageManager->addSuccessMessage(__('The coupon code has been accepted.'));
345345
}
346346
}
347-
}
347+
} else if (isset($data['coupon']['code']) && empty($couponCode)) {
348+
$this->messageManager->addSuccessMessage(__('The coupon has been removed.'));
349+
}
348350

349351
return $this;
350352
}

app/code/Magento/Sales/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,3 +803,4 @@ If set YES Email field will be required during Admin order creation for new Cust
803803
"Could not save the shipment tracking","Could not save the shipment tracking"
804804
"Please enter a coupon code!","Please enter a coupon code!"
805805
"Reorder is not available.","Reorder is not available."
806+
"The coupon code has been removed.","The coupon code has been removed."

app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,10 +1202,7 @@ define([
12021202
for (var i = 0; i < this.loadingAreas.length; i++) {
12031203
var id = this.loadingAreas[i];
12041204
if ($(this.getAreaId(id))) {
1205-
if ('message' != id && response[id]) {
1206-
$(this.getAreaId(id)).update(response[id]);
1207-
}
1208-
if ('message' == id) {
1205+
if ('message' != id || response[id]) {
12091206
$(this.getAreaId(id)).update(response[id]);
12101207
}
12111208
if ($(this.getAreaId(id)).callback) {

0 commit comments

Comments
 (0)