-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix issue with "Apply Discount Code" input hidden, when code is applied #24467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with "Apply Discount Code" input hidden, when code is applied #24467
Conversation
Hi @iGerchak. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@@ -7,7 +7,7 @@ | |||
?> | |||
<div class="block discount" | |||
id="block-discount" | |||
data-mage-init='{"collapsible":{"openedState": "active", "saveState": false}}' | |||
data-mage-init='{"collapsible":{"active": <?= strlen($block->getCouponCode()) ? 'true' : 'false' ?>, "openedState": "active", "saveState": false}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @iGerchak. I think we can simply convert strlen($block->getCouponCode()) to the bool, instead of use comparation operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it was done just in the same way as on line 23 https://github.com/magento/magento2/pull/24467/files#diff-064408e40cf6c624ca3a7a8adfda18a8R23
In this case we should fix that part line also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @iGerchak. Please take a look at my review comment.
Hi @sidolov, thank you for the review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @iGerchak,
I see that in this file there are a lot of places where checked strlen($block->getCouponCode())
.
Could you replace it to $block->getCouponCode()
in all places?
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I just realised that $block->getCouponCode()
will not work for instance if we'll have coupon code 0
. Could you move strlen($block->getCouponCode())
to variable and use it in all places in this file?
Once you'll finish it - please squash all your changes to single commit and force push it.
Thank you!
2169bd6
to
b11f353
Compare
b11f353
to
9da6a58
Compare
Would be great to cover this case with functional tests, I added tag |
Hi @ihor-sviziev, thank you for the review.
|
Hi @VladimirZaets, thank you for the review. |
✔️ QA passed |
Hi @iGerchak, thank you for your contribution! |
Preconditions
Magento 2.3.2
Description
"Apply Discount Code" input should be shown when customer applied coupon code
Steps to reproduce:
Expected result
"Apply Discount Code" input is opened:

Actual result
"Apply Discount Code" input is hidden:

Contribution checklist (*)