-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Resolve "Clear Shopping Cart" button not working in Internet Explorer issue24491 #24499
Resolve "Clear Shopping Cart" button not working in Internet Explorer issue24491 #24499
Conversation
Hi @edenduong. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @dmytro-ch, thank you for the review. |
@magento give me 2.3-develop instance |
Hi @dmytro-ch. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @dmytro-ch, here is your Magento instance. |
Hi @VladimirZaets, thank you for the review. |
$(this.options.emptyCartButton).attr('name', 'update_cart_action_temp'); | ||
$(this.options.updateCartActionContainer) | ||
.attr('name', 'update_cart_action').attr('value', 'empty_cart'); | ||
|
||
if ($(this.options.emptyCartButton).parents('form').length > 0) { |
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.
Can you describe why this fixes the reported bug?
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.
@DrewML: I remove event.detail == 0
because it isn't supported by IE.11.
event.detail
code is added to fix the bug #21499.
I removed it and changed to other solution to fix issue 21499. When the cart is updated, it should't call the emptyCartButton. So I change it to "button" element. So the emptyCartButton isn't trigger click when the qty is update.
@magento give me test instance |
Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you |
Hi @engcom-Alfa, here is your new Magento instance. |
@magento give me 2.3-develop instance |
Hi @engcom-Alfa. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @engcom-Alfa, here is your Magento instance. |
✔️ QA Passed |
…rnet Explorer issue24491 #24499
Hi @edenduong, thank you for your contribution! |
Description (*)
Resolve #24491: "Clear Shopping Cart" button not working in Internet Explorer
The problem:
in this PR: #21499 "Cart is emptied when enter is pressed after changing product quantity". This code is added to
app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js
However, IE 11 can not support
event.detail
. It always return 0https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/16710370/
I believe when enter is pressed after changing product quantity we Shouldn't trigger click "emptyCartButton" and check the condition. I will be wrong. We should change the button empty cart to "button", not "submit". So button isn't clicked when press enter.
In my PR, I have changed it to normal button and process the empty cart only the user click to the "Clear shopping cart" button.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Change Magento Theme to BLANK
Clear Shopping Cart
buttonExpected result (*)
Questions or comments
Contribution checklist (*)