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

minicart not cleared after order completion #4969

Closed
rajesh2590 opened this issue Jun 10, 2016 · 5 comments
Closed

minicart not cleared after order completion #4969

rajesh2590 opened this issue Jun 10, 2016 · 5 comments

Comments

@rajesh2590
Copy link

I'm facing the issue of minicart not cleared after order completion using our custom payment method.

This is the same issue as:
Cart Items are not deleted after success checkout #1461

As we're creating extension for payment method, we've limitation to not to override, modify or inject our content to any view or layout (like onepage/success) after order completion.
i.e; all the process is working on server end in our action controller.

@orlangur
Copy link
Contributor

Please describe your issue as a separate question rather than a comment to a http://magento.stackexchange.com/questions/100615/magento-2-how-can-refresh-minicart-cache-after-clear-cart-session-and-place-orde so that it can be answered.

GitHub is not a right place for this sort of things.

@commcad
Copy link

commcad commented Jun 12, 2016

@orlangur

I also, among another guy I know of, are having the same bug in 2.1.0RC2 where the cart does not empty after a successful purchase. The items that the customer purchase remain active in the shopping cart (minicart).

Steps to reproduce

  1. Upgrade Magento from 2.0.7 to 2.1.0rc2
  2. Customer carry out a purchase on the store using PayPal for instance
  3. The customer receives a "Order have been created" success message, email confirmation and all.

Expected result

  1. the shopping cart clearing itself of the latest purchase.

Actual result

  1. Items remains in the shopping cart, does not clear itself after a successful transaction.

@orlangur RE your comment > GitHub is not a right place for this sort of things. I think it is buddy. We are not reporting these bugs for pure pleasure and entertainment, instead we are trying to contribute in the success of this eCommerce platform. Get it ?!

@orlangur
Copy link
Contributor

Hi @commcad, did you read http://magento.stackexchange.com/a/120407 actually? So @rajesh2590 reported the problem he met with his custom implementation both here on GitHub and there on StackExchange (but as a comment to older question which is misuse of StackExchange).

Your report contains proper steps for core functionality but you didn't report a separate issue on GitHub but commented in two existed issues. This is misuse of GitHub I believe :)

As I explained in #4114 (comment), this type of issue should be pretty easy to debug and fix. So, just go all over the scenario and note which action did not invalidate customer data (a.k.a localStorage) while it have to.

AntonEvers pushed a commit to AntonEvers/magento2 that referenced this issue Jul 13, 2016
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.
@codelogn
Copy link

Thanks, the code for the fix worked for my custom checkout module too.

AntonEvers pushed a commit to AntonEvers/magento2 that referenced this issue Jul 26, 2016
@vkorotun vkorotun removed the CS label Aug 4, 2016
@andimov
Copy link
Contributor

andimov commented Aug 8, 2016

@rajesh2590
Thank you for reporting!
This is a duplicate issue. I'm closing this one. Please, try to use #5807 or wait for MAGETWO-52593.

@andimov andimov closed this as completed Aug 8, 2016
AntonEvers pushed a commit to AntonEvers/magento2 that referenced this issue Sep 10, 2017
Fixes magento#4460 Fixes magento#4416 Fixes magento#1461 Fixes magento#4969 Fixes MAGETWO-52593

(cherry picked from commit 9093ce9)
magento-cicd2 pushed a commit that referenced this issue Jan 28, 2020
[Qwerty] MC-18684: [2.2.x] Remove custom layout updates from admin
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

No branches or pull requests

7 participants