In homepage minicart is not working. I upgraded magento to 2.4.2 version
Asked
Active
Viewed 1,712 times
2
jassi
- 1,344
- 4
- 29
- 50
-
Actually, the issue is closeSidebar is not defined. Where and how closeSidebar function is called in JS is not mentioned. Please have a look. – Suson Waiba Jun 11 '21 at 06:12
2 Answers
2
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
dlicheva
- 350
- 1
- 9
-
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. – kovinet Apr 16 '23 at 11:07
