1

After I upgrade my magento 2.0.7 in magento 2.1.1 I was experiencing this problem in my site. The minicart also is not functioning well.

enter image description here

0

You have to keep inside your minicart.phtml file below code,

keep minicart.phtml file inside your theme,

/app/design/frontend/Vendor/themename/Magento_Checkout/templates/cart/minicart.phtml

In 2.0.7 theme,

<a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
       data-bind="scope: 'minicart_content'">
        <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>
        <span class="counter qty empty"
              data-bind="css: { empty: cart().summary_count == 0 }, blockLoader: isLoading">
            <span class="counter-number"><!-- ko text: cart().summary_count --><!-- /ko --></span>
            <span class="counter-label">
            <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko i18n: 'items' --><!-- /ko -->
            <!-- /ko -->
            </span>
        </span>
    </a>

In new 2.1.1 theme change below code,

<a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
       data-bind="scope: 'minicart_content'">
        <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>
        <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>
    </a>

After apply changes,

please run command,

php bin/magento setup:static-content:deploy

Clear broswer cache.

  • I tried your codes, and followed all your instructions it will work but the minicart is messed up. – MazeStricks Nov 3 '16 at 6:23
  • You have to remove var folder, clear browser cache and run deploy command – Rakesh Jesadiya Nov 3 '16 at 6:29
  • Hello I tried what you've intructed to me. But still the minicart is the same wit the one I posted below. Thanks – MazeStricks Nov 3 '16 at 6:37
  • In console error are removed or still display, Have you clear browswer cache and cookie? – Rakesh Jesadiya Nov 3 '16 at 7:35
  • Yes I did what you say. but sad to say the minicart is still messed up. – MazeStricks Nov 3 '16 at 7:37

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.