Display total price and total items in minicart The 2019 Stack Overflow Developer Survey Results Are InMinicart 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?

Lethal sonic weapons

How to manage monthly salary

Is there a name of the flying bionic bird?

Inline version of a function returns different value then non-inline version

Output the Arecibo Message

Springs with some finite mass

How come people say “Would of”?

Why could you hear an Amstrad CPC working?

Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?

Understanding the implication of what "well-defined" means for the operation in quotient group

Are USB sockets on wall outlets live all the time, even when the switch is off?

Confusion about non-derivable continuous functions

Inversion Puzzle

"What time...?" or "At what time...?" - what is more grammatically correct?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

Why is the maximum length of openwrt’s root password 8 characters?

Access elements in std::string where positon of string is greater than its size

How to change the limits of integration

Time travel alters history but people keep saying nothing's changed

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Why is Grand Jury testimony secret?

Is domain driven design an anti-SQL pattern?

Where to refill my bottle in India?

Where does the "burst of radiance" from Holy Weapon originate?



Display total price and total items in minicart



The 2019 Stack Overflow Developer Survey Results Are InMinicart 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
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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





bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • 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,115612




                    2,115612





















                        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

                                Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                                How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2

                                Nissan Patrol Зміст Перше покоління — 4W60 (1951-1960) | Друге покоління — 60 series (1960-1980) | Третє покоління (1980–2002) | Четверте покоління — Y60 (1987–1998) | П'яте покоління — Y61 (1997–2013) | Шосте покоління — Y62 (2010- ) | Посилання | Зноски | Навігаційне менюОфіційний український сайтТест-драйв Nissan Patrol 2010 7-го поколінняNissan PatrolКак мы тестировали Nissan Patrol 2016рвиправивши або дописавши її