Skip to content

Commit 95cceac

Browse files
committed
ACP2E-2428: Coupon code whitespace issue in checkout page
- static issues
1 parent b9e15e2 commit 95cceac

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

app/code/Magento/Quote/Model/GuestCart/GuestCouponManagement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
}
4242

4343
/**
44-
* {@inheritdoc}
44+
* @inheritdoc
4545
*/
4646
public function get($cartId)
4747
{
@@ -51,7 +51,7 @@ public function get($cartId)
5151
}
5252

5353
/**
54-
* {@inheritdoc}
54+
* @inheritdoc
5555
*/
5656
public function set($cartId, $couponCode)
5757
{
@@ -61,7 +61,7 @@ public function set($cartId, $couponCode)
6161
}
6262

6363
/**
64-
* {@inheritdoc}
64+
* @inheritdoc
6565
*/
6666
public function remove($cartId)
6767
{

app/code/Magento/SalesRule/view/frontend/web/js/view/payment/discount.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ define([
5959
* @returns {Boolean}
6060
*/
6161
validate: function () {
62-
var form = '#discount-form';
63-
$(form + " input[type='text']").each(function () {
64-
$(this).val($(this).val().trim());
65-
})
62+
let form = '#discount-form';
63+
64+
$(form + ' input[type="text"]').each(function () {
65+
let currentValue = $(this).val();
66+
$(this).val(currentValue.trim());
67+
});
6668
return $(form).validation() && $(form).validation('isValid');
6769
}
6870
});

0 commit comments

Comments
 (0)