1

app\design\frontend\test\product\Magento_Checkout\templates\cart\minicart.phtml

  <a class="action desktop 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>

Can anyone brief me??

2 Answers 2

3

Go to Admin -> Stores -> Configuration -> Sales -> Checkout -> MyCart -> Display Cart Summary

There you can change the setting.enter image description here

-1

Use the below code,

$helper = $this->helper('\Magento\Checkout\Helper\Cart'); echo $helper->getItemsCount();

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.