In homepage minicart is not working. I upgraded magento to 2.4.2 version
2 Answers
The method closeSidebar()
has been removed from 2.4
You need to check if you're overridden /Magento_Checkout/web/template/minicart/content.html
in your theme
You need to delete data-bind="visible: closeSidebar()"
and update the data-bind of the close button to:
<button type="button"
id="btn-minicart-close"
class="action close"
data-action="close"
data-bind="
attr: {
title: $t('Close')
},
click: closeMinicart()
">
<span><!-- ko i18n: 'Close' --><!-- /ko --></span>
</button>
The change is here: https://github.com/magento/magento2/pull/28906
-
In my case I don't have the error locally but only on production where mini cart is not rendered. I have been comparing the differences for hours - I still don't get whay closeSidebar() is defined in dev mode but not on prod.– kovinetCommented Apr 16, 2023 at 11:07
have you find a solution? I have the same problem.