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?

Khoa TruongDinh
  • 32,054
  • 11
  • 88
  • 155
Kartik Asodariya
  • 471
  • 1
  • 8
  • 23

1 Answers1

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

Khoa TruongDinh
  • 32,054
  • 11
  • 88
  • 155