I need to show a modal after a product is placed inside cart. This is what i have so far.
This is my default.xml
<body>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="minicart.lightwindow" template="Company_MiniCartLightWindow::minicart_lightWindow.phtml"/>
</referenceContainer>
</body>
This is my template
<div class="modal" id="add-to-cart-modal">
Hello word.
</div>
<script type="text/x-magento-init">
{
"[data-block='minicart']" : {
"Company_MiniCartLightWindow/js/view/minicart_lightwindow" : {}
}
}
</script>
finally this is my js file
define(["jquery/ui","jquery"], function(Component, $){
return function(config, element){
var minicart = $(element);
minicart.on('contentLoading', function () {
minicart.on('contentUpdated', function () {
alert('hello');
});
});
}
});
Not even the alert is triggered after adding product to cart. No errors on js require on console either.
Thank You.