1

enter image description hereenter image description here

Homepage Vs other pages

My theme structure :

I didn't use requirejs-config.js in my theme

enter image description here enter image description here

Problems:

  1. My minicart doesnt't show count item on home page. it show on all other pages.

Here's my minicart.phtml file

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Checkout\Block\Cart\Sidebar */
?>

<div data-block="minicart" class="cart">
    <a class="action showcart" href="<?= /* @escapeNotVerified */ $block->getShoppingCartUrl() ?>"
       data-bind="scope: 'minicart_content'">
        <span class="shopping_bag"><i class="fa fa-shopping-bag"></i><i class="count_cart"><span class="counter qty empty"
                                                                                                 data-bind="css: { empty: !!getCartParam('summary_count') == false }, blockLoader: isLoading">
            <span class="counter-number"><!-- ko text: getCartParam('summary_count') --><!-- /ko --></span>
            <span class="counter-label">
            <!-- ko if: getCartParam('summary_count') -->
                <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                <!-- ko i18n: 'items' --><!-- /ko -->
                <!-- /ko -->
            </span>
        </span></i></span>
<!--        <span class="text">--><?//= /* @escapeNotVerified */ __('My Cart') ?><!--</span>-->

    </a>
    <?php if ($block->getIsNeedToDisplaySideBar()): ?>
        <div class="block block-minicart empty"
             data-role="dropdownDialog"
             data-mage-init='{"dropdownDialog":{
                "appendTo":"[data-block=minicart]",
                "triggerTarget":".showcart",
                "timeout": "2000",
                "closeOnMouseLeave": false,
                "closeOnEscape": true,
                "triggerClass":"active",
                "parentClass":"active",
                "buttons":[]}}'>
            <div id="minicart-content-wrapper" data-bind="scope: 'minicart_content'">
                <!-- ko template: getTemplate() --><!-- /ko -->
            </div>
            <?= $block->getChildHtml('minicart.addons') ?>
        </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>

I think this Javascript doesn't load in my homepage

enter image description here

enter image description here

it show these errors on console enter image description here

8
  • Please check "jquery.mobile.custom.js" file definition in require-config.js file.
    – MR.R DNATH
    Jun 11 '18 at 12:41
  • Please check line number 44 in "jquery.mobile.custom.js".
    – kunj
    Jun 11 '18 at 12:48
  • Is there any menu or have edit anything related to menu?
    – kunj
    Jun 11 '18 at 13:31
  • @kunj that was jQuery issue i degrade jQuery version it's worked on checkout page but there's still mini-cart issue on homepage Jun 11 '18 at 15:25
  • Do you have any errors in js console? Jun 11 '18 at 16:16

Your Answer

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

Browse other questions tagged or ask your own question.