Skip to content

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

Merged

Conversation

ravi-chandra3197
Copy link
Contributor

@ravi-chandra3197 ravi-chandra3197 commented Apr 24, 2019

Description (*)

Fixed Magento is no refreshing the cart page if you delete a product from cart side block

Fixed Issues (if relevant)

  1. Magento is no refreshing the cart page if you delete a product from cart side block #11292: Magento is no refreshing the cart page if you delete a product from cart side block

Manual testing scenarios (*)

  1. Add a product to cart
  2. Go to cart page
  3. Delete the product from cart side block

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 24, 2019

Hi @ravi-chandra3197. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@@ -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();
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

@ghost ghost assigned orlangur Apr 24, 2019
@@ -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();
Copy link
Contributor

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.

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented May 16, 2019

Hi @orlangur,
Currently in case when you'll update product qty from mini cart - it just refreshing the page.
Why do we need to invent new functionality for products deleting?

@sidolov
Copy link
Contributor

sidolov commented Aug 16, 2019

Agree with @ihor-sviziev , just moved reload logic to the appropriate place

@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-5649 has been created to process this Pull Request
✳️ @sidolov, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa
Copy link
Contributor

Hi @ravi-chandra3197

I've checked PR on branch with changes and looks like the issue is not resolved

Manual testing scenario:

  1. Add a product to cart;
  2. Go to Cart page;
  3. Delete product from mini-cart popup;

Actual Result:
❌ Cart page still shows the product in the cart
after

@ravi-chandra3197 Could you take a look?

Thanks!

@ihor-sviziev
Copy link
Contributor

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you

@sidolov
Copy link
Contributor

sidolov commented Aug 23, 2019

@ihor-sviziev ah, yes, we should use indexOf

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Aug 27, 2019

Hi @sidolov

I've checked this PR and looks like changes don't solve the problem.
But with the changes suggested by @ihor-sviziev in #comment all works correctly.

@sidolov Could you take a look, please?

Thanks!

@sidolov
Copy link
Contributor

sidolov commented Aug 27, 2019

@engcom-Alfa , changes are applied, please, check again

@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-5649 has been created to process this Pull Request
✳️ @sidolov, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@ihor-sviziev ihor-sviziev added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Aug 27, 2019
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Actual Result:
after

@engcom-Foxtrot
Copy link
Contributor

@magento run all tests

@m2-assistant
Copy link

m2-assistant bot commented Sep 3, 2019

Hi @ravi-chandra3197, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants