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 #5807

Closed
wants to merge 1 commit into from

Conversation

AntonEvers
Copy link
Contributor

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

@Ctucker9233
Copy link

when is this going to be merged?

Copy link

@LucScu LucScu left a comment

Choose a reason for hiding this comment

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

great, it works

@SerhiyShkolyarenko SerhiyShkolyarenko self-assigned this Oct 4, 2016
@SerhiyShkolyarenko
Copy link
Contributor

SerhiyShkolyarenko commented Oct 4, 2016

@ajpevers thank you for taking part in development. All the issues you mentioned seem to be fixed by internal changes, aren't they? Is any of them still reproducible for you on develop branch or 2.0.9 release?

@Ctucker9233
Copy link

@PieterCappelle is correct. These changes do not appear in 2.1.2.

@AntonEvers
Copy link
Contributor Author

There might be another solution to this problem, so I think only a functional test can tell. I haven't had the time yet to do this.

@Silarn
Copy link

Silarn commented Nov 28, 2016

Running 2.1.2, the minicart does not clear on order place. Testing this fix.

@chinthu
Copy link

chinthu commented Dec 2, 2016

Running 2.1.2, the minicart issue is still there and its not clearing after success checkout

@mamsincl
Copy link
Contributor

Nobody mentioned before, but looks like the issue happens with guest checkout only (v2.1.2)

@sumanta-cn
Copy link

sumanta-cn commented Jan 6, 2017

@mamsincl No, the issue is also occurring for registered customers. I got it at magento version 2.1.2

@kanduvisla
Copy link
Contributor

This bug still occurs in M2.1.3. Can anyone confirm that this patch also solves this issue there?

@Ctucker9233
Copy link

@SerhiyShkolyarenko Any plans to still merge this pull request? Any idea what release version it will be in?

@redelschaap
Copy link
Contributor

redelschaap commented Apr 19, 2017

@SerhiyShkolyarenko Any update on this? Issue still exists in 2.1.5.

@jwittorf
Copy link

Still having the issue in 2.1.6

@surfer190
Copy link

I can confirm that this fix works for Magento 2.1.5. I am unsure what is the hold up in merging this into the repo.
Clearly a common issue.

@nntoan
Copy link
Contributor

nntoan commented May 15, 2017

@surfer190 This is what hold up this merging:

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined
    at Object.getFromServer (customer-data.js:89)
    at Object.reload (customer-data.js:306)
    at (index):525
    at Object.execCb (require.js:1650)
    at Module.check (require.js:866)
    at Module.<anonymous> (require.js:1113)
    at require.js:132
    at require.js:1156
    at each (require.js:57)
    at Module.emit (require.js:1155)

@dnadle
Copy link

dnadle commented May 15, 2017

That error implies that the js/customer-data constructor was called with null settings. Some kind of requirejs or config failure?

I have tried to work around this cart problem by overriding Magento_Checkout/view/frontend/web/js/view/payment/default.js, adding Magento_Customer/js/customer-data to the requirements, and adding the invalidate and reload lines to the afterPlaceOrder function. I don't appear to be getting any Javascript errors after checkout. (I also don't know if it's doing anything because I've never personally been able to reproduce the bug. We've had beta testers report it only once.)

@nntoan
Copy link
Contributor

nntoan commented May 15, 2017

@dnadle That is what exactly I'm doing for my own troubles. Instead of insert new inline javascript to success.phtml or noItems.phtml, we need to add Magento_Customer/js/customer-data into the payment method renderer and inside .done() or .always(), we use this:

customerData.invalidate(['cart']);

Reload section may leads to some potential issue with cache (!)

@AntonEvers
Copy link
Contributor Author

I think a more elegant solution is to invalidate sections the same way as in https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/view/frontend/web/js/customer-data.js#L346 and https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/view/frontend/web/js/customer-data.js#L368.

These invalidations work based on the sections.xml files in modules but they only apply to form submits and post|put|delete calls.
If we can add the visiting of the success page to that list it would be more in line with the current approach.

@erikhansen
Copy link
Contributor

erikhansen commented May 16, 2017

UPDATE 10/11/2017 - It appears that this fix actually did fix the issue. Disregard comment below.

I applied the contents of this patch to a Magento EE 2.1.5 site and pushed it to a server running in production mode. The fix only works intermittently, but for the majority of checkouts, the minicart still shows items on the checkout confirmation page. So I would say that this PR does NOT work and an alternative solution should be used, such as the one that @ajpevers just suggested.

@dnadle
Copy link

dnadle commented May 16, 2017

The actual placement of the order and redirect after success happens in payment/default.js, and there is an afterPlaceOrder callback method defined. I don't understand the resistance to putting the cache invalidation there rather than listening for a get on the success page.

@ishakhsuvarov
Copy link
Contributor

@ajpevers Is this PR still valid? Internal tickets show it as fixed in the develop branch.

@AntonEvers
Copy link
Contributor Author

@ishakhsuvarov close this PR please. I cannot reproduce this issue in the develop branch. You are right.

@AntonEvers AntonEvers closed this Jun 12, 2017
@AntonEvers AntonEvers deleted the patch-6 branch June 13, 2017 05:09
@ishakhsuvarov ishakhsuvarov self-assigned this Jun 14, 2017
@diazwatson
Copy link
Contributor

Anybody advise the status of this issue MAGETWO-52593?

@george-vlahakis
Copy link

I am also getting it on 2.1.7 CE

@julioxx22
Copy link

julioxx22 commented Aug 16, 2017

It's not working on 2.1.7 EE

@GuidoHub
Copy link

Still not works on 2.1.8

@twistedatrocity
Copy link

These changes are not in 2.1.9 either.

@winterk80
Copy link

winterk80 commented Dec 8, 2017

Changes are not in 2.1.8 EE, bug still exists

mmansoor-magento pushed a commit that referenced this pull request Oct 15, 2020
[MPI]MC-31375: Catalog graphQl - position sort doesn't work properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.