1

I would like you help on this I have been reading and reading and cant find an answer. Magento 2.2.3 with a templatemonster theme

This is my minicart.phtml, and the problem is the proceeed to checkout button text is missing on home page, however if I click on edit cart, I can see the text working. In the browser console I get $(...).find(...).dropdownDialog is not a function error.

But if I'm in www.site.com/checkout/cart/configure/etc on the product page I get no error at all. I have tried changing the template files with the core files and it screws up everything else.

* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/** @var $block \Magento\Checkout\Block\Cart\Sidebar */
?>
<div class="rd-navbar-cart-wrap">
<div data-block="minicart" class="minicart-wrapper">
    <div class="rd-navbar-cart-fixed">
        <a class="action showcart rd-navbar-cart-toggle" href="" data-rd-navbar-toggle=".rd-navbar-cart" data-bind="scope: 'minicart_content'">
             <span class="text"><?= /* @escapeNotVerified */  __('My Cart') ?></span>
            <strong class="counter qty empty"
                    data-bind="css: { empty: !!getCartParam('summary_count') == false }, blockLoader: isLoading">
            <strong class="counter-number"><!-- ko text: getCartParam('summary_count') --><!-- /ko --></strong>
                <strong class="counter-label">
                    <!-- ko if: getCartParam('summary_count') -->
                    <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                    <!-- ko i18n: 'items' --><!-- /ko -->
                    <!-- /ko -->
                </strong>
            </strong>
        </a>
    </div>

    <?php if ($block->getIsNeedToDisplaySideBar()): ?>
        <div data-bind="scope: 'minicart_content'" class="rd-navbar-cart">
            <div class="block block-minicart empty">
           <div id="minicart-content-wrapper" data-bind="scope: 'minicart_content'">
                <!-- ko template: getTemplate() --><!-- /ko -->
                </div>
                <?= $block->getChildHtml('minicart.addons') ?>
            </div>
        </div>
    <?php endif ?>
    <script>
        window.checkout = <?= /* @escapeNotVerified */ $block->getSerializedConfig() ?>;
    </script>
    <script type="text/x-magento-init">
    {
        "[data-block='minicart']": {
            "Magento_Ui/js/core/app": <?= /* @escapeNotVerified */  $block->getJsLayout() ?>
        },
        "*": {
            "Magento_Ui/js/block-loader": "<?= /* @escapeNotVerified */  $block->getViewFileUrl('images/loader-1.gif') ?>"
        }
    }
    </script>

</div>

Ok, so, I have been checking both minicart.phtml files (core and template). If I add

data-role="dropdownDialog"
         data-mage-init='{"dropdownDialog":{
            "appendTo":"[data-block=minicart]",
            "triggerTarget":".showcart",
            "timeout": "2000",
            "closeOnMouseLeave": false,
            "closeOnEscape": true,
            "triggerClass":"active",
            "parentClass":"active",
            "buttons":[]}}'>

Under

<div class="block block-minicart empty"

The error in the console goes away, but the minicart does not work in any page, so I'm thinking there has to be something bad in the template, I can post the content.html file too, if you think the error might be there instead. Thank you!

SOLVED

0

All that was needeed was to remove click: closeMinicart() from content.html

Got no more console errors, and everything is working as it should. Hope this helps someone with this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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