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
Labels
bug report Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed

Comments

@nmallepally
Copy link

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
Copy link
Contributor

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
Copy link
Author

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.

@mrkhoa99
Copy link
Contributor

mrkhoa99 commented Aug 5, 2016

@andimov
Copy link
Contributor

andimov commented Aug 8, 2016

@nmallepally
Did you check solution from @mrkhoa99 ?

@nmallepally
Copy link
Author

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

@nmallepally
Copy link
Author

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
Copy link
Author

@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
Copy link
Contributor

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
Copy link
Author

@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
Copy link
Contributor

mrkhoa99 commented Aug 8, 2016

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

@nmallepally
Copy link
Author

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
Copy link
Contributor

Any update on this one? Still exists in 2.1.2.

@bh-ref
Copy link
Contributor

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
Copy link

same here. waiting for update

@danielmartinezd
Copy link

In EE 2.1.5 Still happening

@IlnitskiyArtem
Copy link

@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
Copy link
Author

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

Thanks.

@silici0
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

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 magento-engcom-team added bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Oct 17, 2017
@magento-engcom-team magento-engcom-team added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Oct 17, 2017
@mekiran16
Copy link

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

mmansoor-magento pushed a commit that referenced this issue Oct 15, 2020
[TSG] Fixes for 2.3 (pr122) (2.3-develop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed
Projects
None yet
Development

No branches or pull requests