Fix minicart not cleared after order completion #5625
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
settrue
.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 thecontroller_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:
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.