Skip to content
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 minicart not cleared after order completion #5625

Closed
wants to merge 1 commit into from

Conversation

AntonEvers
Copy link
Contributor

Fixes #4460 Fixes #4416 Fixes #1461 Fixes #4969 Fixes MAGETWO-52593

This method is executed on controller_action_predispatch. The outcome of the following controller will be affected by leaving $this->checkoutSession->setLoadInactive set true.

After placing an order the customer/section/load page is called from the checkout overview page to update the minicart and messages sections. Because of the controller_action_predispatch and the passing of all checks in \Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute setLoadInactive is left set to true and the expired quote is loaded one more time in the minicart, resulting in expired quote data the browser storage for the success page to display.

By the way, I saw this comment:

!$observer->getControllerAction() instanceof \Magento\Checkout\Controller\Onepage
// persistent session does not expire on onepage checkout page to not spoil customer group id

customer/section/load is not a checkout onepage controller, but it most certainly is called in the checkout. So the check in \Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute does not fully fill the gap the way the comment implies.

Fixes magento#4460 Fixes magento#4416 Fixes magento#1461 Fixes magento#4969 Fixes MAGETWO-52593

This method is executed on `controller_action_predispatch`. The outcome of the following controller will be affected by leaving `$this->checkoutSession->setLoadInactive` set `true`.

After placing an order the `customer/section/load` page is called from the checkout overview page to update the minicart and messages sections. Because of the `controller_action_predispatch` and the passing of all checks in `\Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute` `setLoadInactive` is left set to true and the expired quote is loaded one more time in the minicart, resulting in expired quote data the browser storage for the success page to display.

By the way, I saw this comment:

```php
!$observer->getControllerAction() instanceof \Magento\Checkout\Controller\Onepage
// persistent session does not expire on onepage checkout page to not spoil customer group id
```

customer/section/load is not a checkout onepage controller, but it most certainly is called in the checkout. So the check in `\Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute` does not fully fill the gap the way the comment implies.
@AntonEvers
Copy link
Contributor Author

AntonEvers commented Jul 13, 2016

By the way I already signed the CLA once, I have some merged pull requests already, but (no github settings changed) I cannot sign the CLA anymore and I apparently must sign them a second time. #5070

@AntonEvers
Copy link
Contributor Author

This does not fully fix the problem that the mini cart does not clear on the checkout success page. I'll work on a new pull request.

@AntonEvers AntonEvers closed this Jul 26, 2016
@jvreeken
Copy link

I am having this problem to with the cart contents still showing after a successful checkout...
the customer has to manually click remove on the minicart.

Let me know when you figure this one out.

@AntonEvers
Copy link
Contributor Author

@jvreeken see #5807

@AntonEvers AntonEvers deleted the patch-4 branch June 13, 2017 05:09
magento-engcom-team pushed a commit that referenced this pull request Apr 29, 2020
[TR] MC-33706: Merge 2.4-develop into 2.4-develop-php74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants