I have used default Magento 2 mini cart dropdown and my account dropdown it's working fine. But I'm facing the issue if we click my account tab mini cart dropdown still open I want to hide when we click my account tab.
1 Answer
Add below script in app/design/frontend/VENDOR/THEMENAME/Magento_Customer/templates/account/customer.phtml. this will solve your issue
<script type="text/javascript">
requirejs(['jquery'], function($)
{
$('div.block.block-minicart').on('dropdowndialogopen',function ()
{
$('.customer-menu').attr('aria-hidden', 'true');
$('.customer-welcome').removeClass('active');
$('.customer-name').removeClass('active');
});
$(document).on('click.hideDropdown', function (e)
{
$("div.block.block-minicart").dropdownDialog("close");
});
});
</script>
-
1this solution creating an issue, when we have item in mini cart, and we trying to update item quantity or clicking anywhere inside minicart box instead of links then minicart box closing automatically and it's not allow to update the item quantity. please help me out to resolve this issue Jul 8, 2020 at 9:34