Is there any mistake in this code or file structure ? link i followed
what i did
1)app/code/SomeName/AddCartPopUp/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'SomeName_AddCartPopUp',
__DIR__
);
2)app/code/SomeName/AddCartPopUp/view/frontend/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
<body>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="minicart.autoopen" template="SomeName_AddCartPopUp::minicart_open.phtml"/>
</referenceContainer>
</body>
</page>
3)app/code/SomeName/AddCartPopUp/view/frontend/template/minicart_open.phtml
<script type="text/x-magento-init">
{
"[data-block='minicart']" : {
"SomeName_AddCartPopUp/js/view/minicart_open" : {}
}
}
</script>
4)app/code/SomeName/AddCartPopUp/view/frontend/web/js/view/minicart_open.js
define(["jquery/ui","jquery"], function(Component, $){
return function(config, element){
var minicart = $(element);
minicart.on('contentLoading', function () {
minicart.on('contentUpdated', function () {
minicart.find('[data-role="dropdownDialog"]').dropdownDialog("open");
});
});
}
});
5)app/code/SomeName/AddCartPopUp/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
</config>
6)app/code/SomeName/AddCartPopUp/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="SomeName_AddCartPopUp" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>>
</sequence>
</config>