2

In homepage minicart is not working. I upgraded magento to 2.4.2 version

. .

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 Answers2

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
0

have you find a solution? I have the same problem.