-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixed Magento is no refreshing the cart page if you delete a product from cart side block #22478
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
Fixed Magento is no refreshing the cart page if you delete a product from cart side block #22478
Conversation
…from cart side block
Hi @ravi-chandra3197. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
…from cart side block(update var name)
@@ -310,6 +310,10 @@ define([ | |||
|
|||
if (response.success) { | |||
callback.call(this, elem, response); | |||
var currentURL = window.location.pathname; | |||
if (currentURL.includes("/checkout/cart/")) { | |||
location.reload(); |
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.
Nope, such behavior is unacceptable. Please read comments in corresponding issue more carefully.
Needed page content must be re-rendered via AJAX.
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.
Hello @orlangur
As per Expected result issue, we need to reload the page because only mini cart load data using ajax,
but for update same change in checkout/cart/index page, we need reload page
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.
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.
@ravi-chandra3197 expected result is now fixed to avoid confusion
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.
Hello @orlangur
For update mini cart change in cart page, we need to reload checkout/cart/index because it's not a problem to just update product but also subtotal, Discount Code and additional info like shipping charges, so we need to reload cart page instead of re-rendered cart page small part
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.
@ravi-chandra3197 full page reload is not acceptable. Reload only what is needed to be reloaded.
…from cart side block(reload only cart block)
…from cart side block(reload page on delete)
@@ -310,6 +310,10 @@ define([ | |||
|
|||
if (response.success) { | |||
callback.call(this, elem, response); | |||
var currentURL = window.location.pathname; | |||
if (currentURL.includes("/checkout/cart/")) { | |||
location.reload(); |
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.
@ravi-chandra3197 full page reload is not acceptable. Reload only what is needed to be reloaded.
Hi @orlangur, |
Agree with @ihor-sviziev , just moved reload logic to the appropriate place |
Hi @sidolov, thank you for the review.
|
I've checked PR on branch with changes and looks like the issue is not resolved Manual testing scenario:
Actual Result: @ravi-chandra3197 Could you take a look? Thanks! |
@magento-engcom-team give me test instance |
Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you |
@ihor-sviziev ah, yes, we should use indexOf |
Hi @sidolov I've checked this PR and looks like changes don't solve the problem. @sidolov Could you take a look, please? Thanks! |
@engcom-Alfa , changes are applied, please, check again |
Hi @sidolov, thank you for the review.
|
@magento run all tests |
…te a product from cart side block #22478
Hi @ravi-chandra3197, thank you for your contribution! |
Description (*)
Fixed Magento is no refreshing the cart page if you delete a product from cart side block
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)