0

I want to update minicart count. I was found some code regarding mini cart on sections.xml but it works with products not for item count on toplink with cart item.

Now you can see below code what I'm getting regarding the mini cart.

   <?xml version="1.0"?>
   <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
      <action name="modulename/controler/addProduct">
          <section name="cart"/>
      </action>
   </config>

Can you please suggest how can I implement update cart item qty on toplink?

1 Answer 1

0

Your session file should be under etc/frontend folder: app/code/Vendor/MiniCart/etc/frontend/sections.xml.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="{frontName}/{ActionPath}/{ActionName}">
        <section name="cart"/>
    </action>
</config>

We also need to know the item count on mini cart gets the data from local storage: https://magento.stackexchange.com/a/123903/33057

4
  • i have update cart using programatically and i am not using any JS regarding the functionality. Aug 23, 2017 at 4:47
  • update cart using programatically you updated the cart by using controller? Aug 23, 2017 at 4:50
  • yes using controller Aug 23, 2017 at 5:58
  • Can you update your question with full code lines? Aug 23, 2017 at 6:03

Your Answer

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

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