4

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();
5
  • Are you doing this call with Ajax?
    – Smartie
    Feb 6, 2016 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. Feb 6, 2016 at 13:19
  • Please any one who solve that problem Feb 6, 2016 at 15:28
  • Are you doing this with post request?
    – KAndy
    Feb 6, 2016 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 Feb 8, 2016 at 7:28

1 Answer 1

13

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);
        });
12
  • We created quick view after product adding mini cart is updated how to update this ?
    – Vishal
    Feb 24, 2016 at 7:31
  • Create a secton.xml and define path of ajax modilename/controller/action and update section cart on that Feb 25, 2016 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
    – Vishal
    Feb 26, 2016 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 Feb 28, 2016 at 13:06
  • 1
    You can use require([ 'Magento_Customer/js/customer-data' ], function (customerData) { var sections = ['cart']; customerData.invalidate(sections); customerData.reload(sections, true); }); Jun 14, 2017 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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