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

mini cart does not clear after placing an order - magento 2.0.7 #5621

Closed
nmallepally opened this issue Jul 13, 2016 · 23 comments
Closed

mini cart does not clear after placing an order - magento 2.0.7 #5621

nmallepally opened this issue Jul 13, 2016 · 23 comments

Comments

@nmallepally
Copy link

@nmallepally nmallepally commented Jul 13, 2016

Hello,

After i have completed the purchase or placing an order the cart still shows the items and does not remove itself untill any new products added again. it is misleading. can any one give some insight on this?. do i need to upgrade 2.1 to fix or is there any alternative solution.

Thanks,
Navya

@andimov

This comment has been minimized.

Copy link
Contributor

@andimov andimov commented Aug 2, 2016

@nmallepally
Thanks for reporting.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 5, 2016

Hi @andimov
Updated 2.0.7 to 2.1
Product added n checkout
Payment method: Paypal/Cash on Delivery
Payment done successfully
mini cart is not cleared, shows up same products in mini cart.

@andimov

This comment has been minimized.

Copy link
Contributor

@andimov andimov commented Aug 8, 2016

@nmallepally
Did you check solution from @mrkhoa99 ?

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 8, 2016

@andimov I'm checking it after the changes, will update in few minutes.

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 8, 2016

@andimov It returned me a different errors.
Applied changes from this fix
After payment the page returns a network error, page not working on success page, when clicked on reload.
Returns a page checkout/cart saying not items in the cart, which it should not and yet displays the items in the cart.
During the above process payment is made and order is generated.
Attaching images for reference:
cart error
error cart 1

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 8, 2016

@mrkhoa99 Did you see my result above for the fix?, can you advise any alternative solution as we planning to go live in 2days.

@mrkhoa99

This comment has been minimized.

Copy link
Contributor

@mrkhoa99 mrkhoa99 commented Aug 8, 2016

@nmallepally try to get the cart info from your local storage: localStorage.getItem('mage-cache-storage'). Seem the local storage not clear. There is a temporary solution for you, navigate to vendor/magento/module-checkout/view/frontend/templates/cart/noItems.phtml, add the following js code:

<script>
    require([
        'Magento_Customer/js/customer-data'
    ], function (customerData) {
        var sections = ['cart'];
        customerData.invalidate(sections);
        customerData.reload(sections, true);
    });
</script>
@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 8, 2016

@mrkhoa99 Hi thanks for the quick response. works like a charm for paypal orders, does not clear cart when payment is done for cash on delivery method.

@mrkhoa99

This comment has been minimized.

Copy link
Contributor

@mrkhoa99 mrkhoa99 commented Aug 8, 2016

@nmallepally Can you list the files which you applied the paths?

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Aug 8, 2016

I'm using magento 2.1v. I just applied the above java script into vendor/magento/module-checkout/view/frontend/templates/cart/noItems.phtml. As you said this is a temporary solution. Did i miss anything?

@PieterCappelle

This comment has been minimized.

Copy link
Contributor

@PieterCappelle PieterCappelle commented Oct 19, 2016

Any update on this one? Still exists in 2.1.2.

@bh-ref

This comment has been minimized.

Copy link
Contributor

@bh-ref bh-ref commented Feb 22, 2017

encountered this bug in CE 2.1.4 as well. it happens when I DON'T sign into my customer account at checkout.

@refaelgold

This comment has been minimized.

Copy link

@refaelgold refaelgold commented Apr 5, 2017

same here. waiting for update

@danielmartinezd

This comment has been minimized.

Copy link

@danielmartinezd danielmartinezd commented May 3, 2017

In EE 2.1.5 Still happening

@IlnitskiyArtem

This comment has been minimized.

Copy link

@IlnitskiyArtem IlnitskiyArtem commented Jul 6, 2017

@nmallepally Thanks for the feedback. Is your issue relevant for latest Magento versions?
We need more information about your configuration to reproduce this issue. Please identify the web server you are running, the versions of PHP and MySQL, and any other information needed to reproduce your issue.

@nmallepally

This comment has been minimized.

Copy link
Author

@nmallepally nmallepally commented Jul 6, 2017

Hi,
I have updated to Magento version 2.1.6, I have no issues now.
the cart clears after placing an order.

Thanks.

@silici0

This comment has been minimized.

Copy link

@silici0 silici0 commented Jul 12, 2017

Hello,
Im using Magento 2.1.7 fresh install and the problem persist, i have changed /vender/magento, is this the best practice?

@korostii

This comment has been minimized.

Copy link
Contributor

@korostii korostii commented Jul 12, 2017

No, editing /vendor/magento isn't considered best practice because your changes will be overwritten with stock files once you update to a newer version of Magento. You'll need to keep track of the all the patches you've applied and re-apply them after each update if you select this method.

@orlangur

This comment has been minimized.

Copy link
Contributor

@orlangur orlangur commented Jul 12, 2017

I've even met some composer plugins which allow to re-apply patches automatically 🤣 Please don't go this way.

@silici0 just customize needed template according to http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-override.html#override mentioning in comment where the patch came from and for which version so that you can easily drop it when it is not relevant anymore due to Magento upgrade.

@silici0

This comment has been minimized.

Copy link

@silici0 silici0 commented Jul 13, 2017

@orlangur Ty, i have uploaded a module that fix the problem, im still learning, i would appreciate a code review :)

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Oct 17, 2017

@nmallepally, thank you for your report.
The issue is already fixed in develop branch, 2.2.0, 2.1.9

@mekiran16

This comment has been minimized.

Copy link

@mekiran16 mekiran16 commented Jan 19, 2018

Hello,
Please add below small script in following file path. it's work for me.

app/design/frontend///Magento_Checkout/templates/cart/noItems.phtml
app/design/frontend///Magento_Checkout/templates/success.phtml

<script>
require([
     'Magento_Customer/js/customer-data'
 ], function (customerData) {
     var sections = ['cart'];
     customerData.invalidate(sections);
     //customerData.reload(sections, true);
 });
</script>

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.