Display total price and total items in minicart The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Minicart in header is cached by FPCmini cart not showing itemsHow to display price times quantity in minicartIs it possible to add the rwd minicart to my own custom theme, and if so how could I do itrender minicart in custom layout - Magento 2Magento 2 minicartMagento 2 Minicart - Display line item subtotal rather than unit priceMagento 2: Show total items count in Knockout templateUpdate quantity in minicartMini cart content not rendering properly in Magento 2?

Do warforged have souls?

When did F become S? Why?

Why is the object placed in the middle of the sentence here?

He got a vote 80% that of Emmanuel Macron’s

Keeping a retro style to sci-fi spaceships?

A pet rabbit called Belle

How does this infinite series simplify to an integral?

system call string length limit

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Are my PIs rude or am I just being too sensitive?

Why can't wing-mounted spoilers be used to steepen approaches?

Match Roman Numerals

How to prevent selfdestruct from another contract

How did passengers keep warm on sail ships?

Do working physicists consider Newtonian mechanics to be "falsified"?

I could not break this equation. Please help me

Am I ethically obligated to go into work on an off day if the reason is sudden?

How to test the equality of two Pearson correlation coefficients computed from the same sample?

Windows 10: How to Lock (not sleep) laptop on lid close?

How are presidential pardons supposed to be used?

Road tyres vs "Street" tyres for charity ride on MTB Tandem

Mortgage adviser recommends a longer term than necessary combined with overpayments

What's the point in a preamp?

How to pronounce 1ターン?



Display total price and total items in minicart



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Minicart in header is cached by FPCmini cart not showing itemsHow to display price times quantity in minicartIs it possible to add the rwd minicart to my own custom theme, and if so how could I do itrender minicart in custom layout - Magento 2Magento 2 minicartMagento 2 Minicart - Display line item subtotal rather than unit priceMagento 2: Show total items count in Knockout templateUpdate quantity in minicartMini cart content not rendering properly in Magento 2?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I have installed magento 2.0.7 and overide the template minicart.phtml to my custom theme. I want to show total price and total items in the header minicart like the below imageenter image description here










share|improve this question
























  • Hi, have you found solution to above ? as I am Looking for the same.

    – Arun Karnawat
    Jul 25 '16 at 8:00












  • Yes arun.I will post my answer

    – Asha
    Jul 28 '16 at 7:03











  • thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

    – Arun Karnawat
    Jul 28 '16 at 8:20

















6















I have installed magento 2.0.7 and overide the template minicart.phtml to my custom theme. I want to show total price and total items in the header minicart like the below imageenter image description here










share|improve this question
























  • Hi, have you found solution to above ? as I am Looking for the same.

    – Arun Karnawat
    Jul 25 '16 at 8:00












  • Yes arun.I will post my answer

    – Asha
    Jul 28 '16 at 7:03











  • thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

    – Arun Karnawat
    Jul 28 '16 at 8:20













6












6








6








I have installed magento 2.0.7 and overide the template minicart.phtml to my custom theme. I want to show total price and total items in the header minicart like the below imageenter image description here










share|improve this question
















I have installed magento 2.0.7 and overide the template minicart.phtml to my custom theme. I want to show total price and total items in the header minicart like the below imageenter image description here







magento2 mini-cart






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 6 '16 at 10:44







Asha

















asked Jun 6 '16 at 10:37









AshaAsha

3422522




3422522












  • Hi, have you found solution to above ? as I am Looking for the same.

    – Arun Karnawat
    Jul 25 '16 at 8:00












  • Yes arun.I will post my answer

    – Asha
    Jul 28 '16 at 7:03











  • thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

    – Arun Karnawat
    Jul 28 '16 at 8:20

















  • Hi, have you found solution to above ? as I am Looking for the same.

    – Arun Karnawat
    Jul 25 '16 at 8:00












  • Yes arun.I will post my answer

    – Asha
    Jul 28 '16 at 7:03











  • thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

    – Arun Karnawat
    Jul 28 '16 at 8:20
















Hi, have you found solution to above ? as I am Looking for the same.

– Arun Karnawat
Jul 25 '16 at 8:00






Hi, have you found solution to above ? as I am Looking for the same.

– Arun Karnawat
Jul 25 '16 at 8:00














Yes arun.I will post my answer

– Asha
Jul 28 '16 at 7:03





Yes arun.I will post my answer

– Asha
Jul 28 '16 at 7:03













thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

– Arun Karnawat
Jul 28 '16 at 8:20





thank you, I have figured it out, but if you can, I want $00 - 0 item to be printed by default if 0 product is in the cart. in Magento 2.1.0. Thank you

– Arun Karnawat
Jul 28 '16 at 8:20










4 Answers
4






active

oldest

votes


















0














I believe you will need to use AJAX along with the API unless there is already a function for this in the Magento/Checkout/Model... Find the minicart knockout js template for an example already in your code.



http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_overview.html



http://devdocs.magento.com/guides/v2.0/extension-dev-guide/bk-extension-dev-guide.html






share|improve this answer






























    0














    Please make a copy of minicart.phtml file in your theme (appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml) and add the below code in it



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

    // @codingStandardsIgnoreFile

    /** @var $block MagentoCheckoutBlockCartSidebar */
    ?>
    <?php $helper = $this->helper('MagentoCheckoutHelperCart');?>
    <div data-block="minicart" class="minicart-wrapper">
    <a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
    data-bind="scope: 'minicart_content'">
    <span class="text"><?php /* @escapeNotVerified */ echo __('Shopping Cart'); ?></span>
    <span class="counter qty empty"
    data-bind="css: empty: cart().summary_count < 0 , blockLoader: isLoading">
    <span class="ex-top-cart-subtotal">
    <!-- ko if: cart().summary_count -->
    <!-- ko if: cart().possible_onepage_checkout -->
    <!-- ko foreach: getRegion('subtotalContainer') -->
    <!-- ko template: getTemplate() --><!-- /ko -->&nbsp;-&nbsp;
    <!-- /ko -->
    <!-- /ko -->
    <!-- /ko --></span>

    <span class="counter-label">
    <!-- ko ifnot: cart().summary_count -->
    &pound; <!-- ko i18n: ' 0.00 - 0 item ' --><!-- /ko -->
    <!-- /ko -->
    <!-- ko if: cart().summary_count -->
    <!-- ko text: cart().summary_count --><!-- /ko -->
    <!-- ko if: cart().summary_count == 1 -->
    <!-- ko i18n: 'item' --><!-- /ko -->
    <!-- /ko -->
    <!-- ko if: cart().summary_count > 1 -->
    <!-- ko i18n: 'items' --><!-- /ko -->
    <!-- /ko -->
    <!-- /ko -->

    <?php //echo "&pound; ".number_format($helper->getQuote()->getSubtotal(), 2, '.', '');?>
    </span>

    </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>
    </div>
    <?php endif ?>
    <script>
    window.checkout = <?php /* @escapeNotVerified */ echo Zend_Json::encode($block->getConfig()); ?>;
    </script>
    <script type="text/x-magento-init">

    "[data-block='minicart']":
    "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
    ,
    "*":
    "Magento_Ui/js/block-loader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"


    </script>
    </div>





    share|improve this answer























    • please explain what you changed....

      – Philipp Sander
      Dec 16 '16 at 13:10


















    0














    Go to this directory appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml



    and overwrite with below code in minicart.phtml file.



    <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 , css: empty: !cart().summary_count , blockLoader: isLoading">
    <span class="counter-number">

    <!-- ko if: !cart().summary_count -->
    <!-- ko i18n: '0 item' --><!-- /ko -->
    <!-- /ko -->
    <!-- ko if: cart().summary_count >= 1 -->
    <!-- ko text: cart().summary_count --><!-- /ko -->
    <!-- ko i18n: ' items' --><!-- /ko -->
    <!-- /ko -->
    </span>
    <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"> </span>
    <span class="price-custom-minicart">
    <!-- ko if: !cart().subtotal_excl_tax -->
    <!-- ko i18n: '€ 0.00' --><!-- /ko -->
    <!-- /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>





    share|improve this answer






























      0














      Working code for me. Magento 2.2.4



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

      <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>

      <span data-bind="html: getCartParam('subtotal')"></span>
      <!-- /ko -->
      <!-- ko if: getCartParam('summary_count') != 1 -->
      <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
      <!-- ko i18n: 'items' --><!-- /ko -->
      <span data-bind="html: getCartParam('subtotal')"></span>
      <!-- /ko -->
      </span>

      </a>





      share|improve this answer























        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "479"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f119512%2fdisplay-total-price-and-total-items-in-minicart%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        I believe you will need to use AJAX along with the API unless there is already a function for this in the Magento/Checkout/Model... Find the minicart knockout js template for an example already in your code.



        http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_overview.html



        http://devdocs.magento.com/guides/v2.0/extension-dev-guide/bk-extension-dev-guide.html






        share|improve this answer



























          0














          I believe you will need to use AJAX along with the API unless there is already a function for this in the Magento/Checkout/Model... Find the minicart knockout js template for an example already in your code.



          http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_overview.html



          http://devdocs.magento.com/guides/v2.0/extension-dev-guide/bk-extension-dev-guide.html






          share|improve this answer

























            0












            0








            0







            I believe you will need to use AJAX along with the API unless there is already a function for this in the Magento/Checkout/Model... Find the minicart knockout js template for an example already in your code.



            http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_overview.html



            http://devdocs.magento.com/guides/v2.0/extension-dev-guide/bk-extension-dev-guide.html






            share|improve this answer













            I believe you will need to use AJAX along with the API unless there is already a function for this in the Magento/Checkout/Model... Find the minicart knockout js template for an example already in your code.



            http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_overview.html



            http://devdocs.magento.com/guides/v2.0/extension-dev-guide/bk-extension-dev-guide.html







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 6 '16 at 11:13









            LM_FieldingLM_Fielding

            7281437




            7281437























                0














                Please make a copy of minicart.phtml file in your theme (appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml) and add the below code in it



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

                // @codingStandardsIgnoreFile

                /** @var $block MagentoCheckoutBlockCartSidebar */
                ?>
                <?php $helper = $this->helper('MagentoCheckoutHelperCart');?>
                <div data-block="minicart" class="minicart-wrapper">
                <a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
                data-bind="scope: 'minicart_content'">
                <span class="text"><?php /* @escapeNotVerified */ echo __('Shopping Cart'); ?></span>
                <span class="counter qty empty"
                data-bind="css: empty: cart().summary_count < 0 , blockLoader: isLoading">
                <span class="ex-top-cart-subtotal">
                <!-- ko if: cart().summary_count -->
                <!-- ko if: cart().possible_onepage_checkout -->
                <!-- ko foreach: getRegion('subtotalContainer') -->
                <!-- ko template: getTemplate() --><!-- /ko -->&nbsp;-&nbsp;
                <!-- /ko -->
                <!-- /ko -->
                <!-- /ko --></span>

                <span class="counter-label">
                <!-- ko ifnot: cart().summary_count -->
                &pound; <!-- ko i18n: ' 0.00 - 0 item ' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko if: cart().summary_count == 1 -->
                <!-- ko i18n: 'item' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count > 1 -->
                <!-- ko i18n: 'items' --><!-- /ko -->
                <!-- /ko -->
                <!-- /ko -->

                <?php //echo "&pound; ".number_format($helper->getQuote()->getSubtotal(), 2, '.', '');?>
                </span>

                </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>
                </div>
                <?php endif ?>
                <script>
                window.checkout = <?php /* @escapeNotVerified */ echo Zend_Json::encode($block->getConfig()); ?>;
                </script>
                <script type="text/x-magento-init">

                "[data-block='minicart']":
                "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
                ,
                "*":
                "Magento_Ui/js/block-loader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"


                </script>
                </div>





                share|improve this answer























                • please explain what you changed....

                  – Philipp Sander
                  Dec 16 '16 at 13:10















                0














                Please make a copy of minicart.phtml file in your theme (appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml) and add the below code in it



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

                // @codingStandardsIgnoreFile

                /** @var $block MagentoCheckoutBlockCartSidebar */
                ?>
                <?php $helper = $this->helper('MagentoCheckoutHelperCart');?>
                <div data-block="minicart" class="minicart-wrapper">
                <a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
                data-bind="scope: 'minicart_content'">
                <span class="text"><?php /* @escapeNotVerified */ echo __('Shopping Cart'); ?></span>
                <span class="counter qty empty"
                data-bind="css: empty: cart().summary_count < 0 , blockLoader: isLoading">
                <span class="ex-top-cart-subtotal">
                <!-- ko if: cart().summary_count -->
                <!-- ko if: cart().possible_onepage_checkout -->
                <!-- ko foreach: getRegion('subtotalContainer') -->
                <!-- ko template: getTemplate() --><!-- /ko -->&nbsp;-&nbsp;
                <!-- /ko -->
                <!-- /ko -->
                <!-- /ko --></span>

                <span class="counter-label">
                <!-- ko ifnot: cart().summary_count -->
                &pound; <!-- ko i18n: ' 0.00 - 0 item ' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko if: cart().summary_count == 1 -->
                <!-- ko i18n: 'item' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count > 1 -->
                <!-- ko i18n: 'items' --><!-- /ko -->
                <!-- /ko -->
                <!-- /ko -->

                <?php //echo "&pound; ".number_format($helper->getQuote()->getSubtotal(), 2, '.', '');?>
                </span>

                </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>
                </div>
                <?php endif ?>
                <script>
                window.checkout = <?php /* @escapeNotVerified */ echo Zend_Json::encode($block->getConfig()); ?>;
                </script>
                <script type="text/x-magento-init">

                "[data-block='minicart']":
                "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
                ,
                "*":
                "Magento_Ui/js/block-loader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"


                </script>
                </div>





                share|improve this answer























                • please explain what you changed....

                  – Philipp Sander
                  Dec 16 '16 at 13:10













                0












                0








                0







                Please make a copy of minicart.phtml file in your theme (appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml) and add the below code in it



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

                // @codingStandardsIgnoreFile

                /** @var $block MagentoCheckoutBlockCartSidebar */
                ?>
                <?php $helper = $this->helper('MagentoCheckoutHelperCart');?>
                <div data-block="minicart" class="minicart-wrapper">
                <a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
                data-bind="scope: 'minicart_content'">
                <span class="text"><?php /* @escapeNotVerified */ echo __('Shopping Cart'); ?></span>
                <span class="counter qty empty"
                data-bind="css: empty: cart().summary_count < 0 , blockLoader: isLoading">
                <span class="ex-top-cart-subtotal">
                <!-- ko if: cart().summary_count -->
                <!-- ko if: cart().possible_onepage_checkout -->
                <!-- ko foreach: getRegion('subtotalContainer') -->
                <!-- ko template: getTemplate() --><!-- /ko -->&nbsp;-&nbsp;
                <!-- /ko -->
                <!-- /ko -->
                <!-- /ko --></span>

                <span class="counter-label">
                <!-- ko ifnot: cart().summary_count -->
                &pound; <!-- ko i18n: ' 0.00 - 0 item ' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko if: cart().summary_count == 1 -->
                <!-- ko i18n: 'item' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count > 1 -->
                <!-- ko i18n: 'items' --><!-- /ko -->
                <!-- /ko -->
                <!-- /ko -->

                <?php //echo "&pound; ".number_format($helper->getQuote()->getSubtotal(), 2, '.', '');?>
                </span>

                </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>
                </div>
                <?php endif ?>
                <script>
                window.checkout = <?php /* @escapeNotVerified */ echo Zend_Json::encode($block->getConfig()); ?>;
                </script>
                <script type="text/x-magento-init">

                "[data-block='minicart']":
                "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
                ,
                "*":
                "Magento_Ui/js/block-loader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"


                </script>
                </div>





                share|improve this answer













                Please make a copy of minicart.phtml file in your theme (appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml) and add the below code in it



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

                // @codingStandardsIgnoreFile

                /** @var $block MagentoCheckoutBlockCartSidebar */
                ?>
                <?php $helper = $this->helper('MagentoCheckoutHelperCart');?>
                <div data-block="minicart" class="minicart-wrapper">
                <a class="action showcart" href="<?php /* @escapeNotVerified */ echo $block->getShoppingCartUrl(); ?>"
                data-bind="scope: 'minicart_content'">
                <span class="text"><?php /* @escapeNotVerified */ echo __('Shopping Cart'); ?></span>
                <span class="counter qty empty"
                data-bind="css: empty: cart().summary_count < 0 , blockLoader: isLoading">
                <span class="ex-top-cart-subtotal">
                <!-- ko if: cart().summary_count -->
                <!-- ko if: cart().possible_onepage_checkout -->
                <!-- ko foreach: getRegion('subtotalContainer') -->
                <!-- ko template: getTemplate() --><!-- /ko -->&nbsp;-&nbsp;
                <!-- /ko -->
                <!-- /ko -->
                <!-- /ko --></span>

                <span class="counter-label">
                <!-- ko ifnot: cart().summary_count -->
                &pound; <!-- ko i18n: ' 0.00 - 0 item ' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko if: cart().summary_count == 1 -->
                <!-- ko i18n: 'item' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count > 1 -->
                <!-- ko i18n: 'items' --><!-- /ko -->
                <!-- /ko -->
                <!-- /ko -->

                <?php //echo "&pound; ".number_format($helper->getQuote()->getSubtotal(), 2, '.', '');?>
                </span>

                </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>
                </div>
                <?php endif ?>
                <script>
                window.checkout = <?php /* @escapeNotVerified */ echo Zend_Json::encode($block->getConfig()); ?>;
                </script>
                <script type="text/x-magento-init">

                "[data-block='minicart']":
                "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
                ,
                "*":
                "Magento_Ui/js/block-loader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-1.gif'); ?>"


                </script>
                </div>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 28 '16 at 7:09









                AshaAsha

                3422522




                3422522












                • please explain what you changed....

                  – Philipp Sander
                  Dec 16 '16 at 13:10

















                • please explain what you changed....

                  – Philipp Sander
                  Dec 16 '16 at 13:10
















                please explain what you changed....

                – Philipp Sander
                Dec 16 '16 at 13:10





                please explain what you changed....

                – Philipp Sander
                Dec 16 '16 at 13:10











                0














                Go to this directory appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml



                and overwrite with below code in minicart.phtml file.



                <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 , css: empty: !cart().summary_count , blockLoader: isLoading">
                <span class="counter-number">

                <!-- ko if: !cart().summary_count -->
                <!-- ko i18n: '0 item' --><!-- /ko -->
                <!-- /ko -->
                <!-- ko if: cart().summary_count >= 1 -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko i18n: ' items' --><!-- /ko -->
                <!-- /ko -->
                </span>
                <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"> </span>
                <span class="price-custom-minicart">
                <!-- ko if: !cart().subtotal_excl_tax -->
                <!-- ko i18n: '€ 0.00' --><!-- /ko -->
                <!-- /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>





                share|improve this answer



























                  0














                  Go to this directory appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml



                  and overwrite with below code in minicart.phtml file.



                  <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 , css: empty: !cart().summary_count , blockLoader: isLoading">
                  <span class="counter-number">

                  <!-- ko if: !cart().summary_count -->
                  <!-- ko i18n: '0 item' --><!-- /ko -->
                  <!-- /ko -->
                  <!-- ko if: cart().summary_count >= 1 -->
                  <!-- ko text: cart().summary_count --><!-- /ko -->
                  <!-- ko i18n: ' items' --><!-- /ko -->
                  <!-- /ko -->
                  </span>
                  <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"> </span>
                  <span class="price-custom-minicart">
                  <!-- ko if: !cart().subtotal_excl_tax -->
                  <!-- ko i18n: '€ 0.00' --><!-- /ko -->
                  <!-- /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>





                  share|improve this answer

























                    0












                    0








                    0







                    Go to this directory appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml



                    and overwrite with below code in minicart.phtml file.



                    <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 , css: empty: !cart().summary_count , blockLoader: isLoading">
                    <span class="counter-number">

                    <!-- ko if: !cart().summary_count -->
                    <!-- ko i18n: '0 item' --><!-- /ko -->
                    <!-- /ko -->
                    <!-- ko if: cart().summary_count >= 1 -->
                    <!-- ko text: cart().summary_count --><!-- /ko -->
                    <!-- ko i18n: ' items' --><!-- /ko -->
                    <!-- /ko -->
                    </span>
                    <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"> </span>
                    <span class="price-custom-minicart">
                    <!-- ko if: !cart().subtotal_excl_tax -->
                    <!-- ko i18n: '€ 0.00' --><!-- /ko -->
                    <!-- /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>





                    share|improve this answer













                    Go to this directory appdesignfrontendyourpackageyourthemeMagento_Checkouttemplatescartminicart.phtml



                    and overwrite with below code in minicart.phtml file.



                    <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 , css: empty: !cart().summary_count , blockLoader: isLoading">
                    <span class="counter-number">

                    <!-- ko if: !cart().summary_count -->
                    <!-- ko i18n: '0 item' --><!-- /ko -->
                    <!-- /ko -->
                    <!-- ko if: cart().summary_count >= 1 -->
                    <!-- ko text: cart().summary_count --><!-- /ko -->
                    <!-- ko i18n: ' items' --><!-- /ko -->
                    <!-- /ko -->
                    </span>
                    <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"> </span>
                    <span class="price-custom-minicart">
                    <!-- ko if: !cart().subtotal_excl_tax -->
                    <!-- ko i18n: '€ 0.00' --><!-- /ko -->
                    <!-- /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>






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 5 '16 at 10:05









                    Abhinav SinghAbhinav Singh

                    2,135612




                    2,135612





















                        0














                        Working code for me. Magento 2.2.4



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

                        <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>

                        <span data-bind="html: getCartParam('subtotal')"></span>
                        <!-- /ko -->
                        <!-- ko if: getCartParam('summary_count') != 1 -->
                        <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                        <!-- ko i18n: 'items' --><!-- /ko -->
                        <span data-bind="html: getCartParam('subtotal')"></span>
                        <!-- /ko -->
                        </span>

                        </a>





                        share|improve this answer



























                          0














                          Working code for me. Magento 2.2.4



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

                          <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>

                          <span data-bind="html: getCartParam('subtotal')"></span>
                          <!-- /ko -->
                          <!-- ko if: getCartParam('summary_count') != 1 -->
                          <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                          <!-- ko i18n: 'items' --><!-- /ko -->
                          <span data-bind="html: getCartParam('subtotal')"></span>
                          <!-- /ko -->
                          </span>

                          </a>





                          share|improve this answer

























                            0












                            0








                            0







                            Working code for me. Magento 2.2.4



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

                            <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>

                            <span data-bind="html: getCartParam('subtotal')"></span>
                            <!-- /ko -->
                            <!-- ko if: getCartParam('summary_count') != 1 -->
                            <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                            <!-- ko i18n: 'items' --><!-- /ko -->
                            <span data-bind="html: getCartParam('subtotal')"></span>
                            <!-- /ko -->
                            </span>

                            </a>





                            share|improve this answer













                            Working code for me. Magento 2.2.4



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

                            <span class="text"><?php /* @escapeNotVerified */ echo __('My Cart'); ?></span>

                            <span data-bind="html: getCartParam('subtotal')"></span>
                            <!-- /ko -->
                            <!-- ko if: getCartParam('summary_count') != 1 -->
                            <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
                            <!-- ko i18n: 'items' --><!-- /ko -->
                            <span data-bind="html: getCartParam('subtotal')"></span>
                            <!-- /ko -->
                            </span>

                            </a>






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 22 '18 at 11:01









                            Nadeem0035Nadeem0035

                            593411




                            593411



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Magento Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f119512%2fdisplay-total-price-and-total-items-in-minicart%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

                                БиармияSxpst500bh2ntaf! 3h2r