3

enter image description here

How can resolve that issue .I remove all session

$this->_checkoutSession->clearQuote()->clearStorage();
    $this->_checkoutSession->clearQuote();
    $this->_checkoutSession->clearStorage();
    $this->_checkoutSession->clearHelperData();
    $this->_checkoutSession->resetCheckout();
    $this->_checkoutSession->restoreQuote();
  • Are you doing this call with Ajax? – Smartie Feb 6 '16 at 12:12
  • Not i am not using ajax but i create order programmatic and own success page so give me advice what happens i try many cases every time cache maintained. – Prince Yadav Feb 6 '16 at 13:19
  • Please any one who solve that problem – Prince Yadav Feb 6 '16 at 15:28
  • Are you doing this with post request? – KAndy Feb 6 '16 at 16:48
  • Not I create a order programmability Can you please tell me how can i fire request to update minicart sidebar in magent2 – Prince Yadav Feb 8 '16 at 7:28
11

I found that solution

For update minicart section first we create a sections.xml in /etc/frontend/

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="test/process/observer">
        <section name="cart"/>
    </action>
</config>

And after apply Ajax on particular section phtml

And one more solution founded

require([
           'Magento_Customer/js/customer-data'
        ], function (customerData) {
            var sections = ['cart'];
            customerData.invalidate(sections);
            customerData.reload(sections, true);
        });
| improve this answer | |
  • We created quick view after product adding mini cart is updated how to update this ? – MagikVishal Feb 24 '16 at 7:31
  • Create a secton.xml and define path of ajax modilename/controller/action and update section cart on that – Prince Yadav Feb 25 '16 at 15:58
  • 1
    We created sections.xml <action name="checkout/cart/add"> <section name="cart"/> </action> but which file is ajax on particular section phtml i dont understand – MagikVishal Feb 26 '16 at 7:24
  • Action means that url which you are using in ajax and create section file in custom module for update cart on a particular action – Prince Yadav Feb 28 '16 at 13:06
  • It's ok when you call a particular action, but imagine you empty your cart through an observer. How to tell Magento to refresh the section ? – Pol Ravalitera Apr 5 '17 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.