2

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

. .

1
  • Actually, the issue is closeSidebar is not defined. Where and how closeSidebar function is called in JS is not mentioned. Please have a look. Commented Jun 11, 2021 at 6:12

2 Answers 2

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

1
  • 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
    Commented Apr 16, 2023 at 11:07
0

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

1
  • copy the vendor folder template
    – jassi
    Commented Oct 18, 2021 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.