I have create a custom module and perform the action using ajax call. I have created the sections.xml and update the below code.
<?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="southlincprotection/Index/Index">
<section name="cart"/>
</action>
</config>
but it is not working and not updating the minicart item after succesfull ajax execution. can anyone please let me where I am doing mistakes.
Package Name >> Southlinc
Module Name >> Protection
Controller >> Index >> Index.php
I have defined the frontname "southlincprotection" in routes.xml
my Ajax code is below
var param = 'quoteid=<?php echo $quoteId; ?>&ajax=1';
$.ajax({
showLoader: true,
url: '<?php echo $baseUrl; ?>southlincprotection',
data: param,
type: "POST",
dataType: 'json'
});
Best Answer
The ajax
mini cart updated
code below work for, you can try this.