Magento2 I am programmatiacally removing cart items.
$quoteItems = $this->checkoutSession->getQuote()->getItemsCollection();
foreach($quoteItems as $item)
{
$cart->removeItem($item->getId())->save();
}
My issue is mini cart counter is not getting updated
It just gets reduced by 1. Lets say if I have 3 items it will get reduced by 1 & change to 2.
I have already tried
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="inquiry/index/save">
<section name="cart"/>
</action>
</config>
And this
var sections = ['cart'];
customerData.reload(sections, true);