On checkout page I want subtotal, shipping and grand total in both "Shipping" and "Payment" steps.

I have followed this https://magento.stackexchange.com/a/235329/31910 :

In view/frontend/requirejs-config.js:

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/summary/abstract-total': {
                'Vendor_Module/js/abstract-total-mixin': true

In view/frontend/web/js/abstract-total-mixin.js:

define([], function () {
    "use strict";

    return function (target) {
        return target.extend({
             * @return {*}
            isFullMode: function () {
                if (!this.getTotals()) {
                    return false;

                return true;

After this I have got Shipping amount and Grand total, but there is no subtotal appearing.
enter image description here

My question is, How can I show subtotal in checkout?

1 Answer 1


I have create the custom module and get the subtotal value Please check code hope help you,



namespace Mage\Subtotal\Block\Checkout;

class Quoteinfo extends \Magento\Framework\View\Element\Template 
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context, 
        \Magento\Checkout\Model\Session $checkoutSession, 
        array $data = []
        parent::__construct($context, $data);
        $this->_checkoutSession = $checkoutSession;
    public function getQuoteData()
        if (!$this->hasData('quote')) {
            $this->setData('quote', $this->_checkoutSession->getQuote());
        return $this->_getData('quote');


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Mage_Subtotal" setup_version="2.0.0"/>


<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="content">
            <block class="Mage\Subtotal\Block\Checkout\Quoteinfo" before="" cacheable="false" template="Mage_Subtotal::checkout/quoteinfo.phtml">

Set Your right position.


$quote = $block->getQuoteData();
//Get subtotal and grand total of customer current cart
<div class="subtotal">
<?php echo __('Cart Subtotal'); ?>
<?php echo $subTotal = $quote->getSubtotal(); ?>



Cart subtotal value move your right position

I hope help you


  • you code is good, it will show subtotal in content, but I don't want to show subtotal anywhere in content, instead I want to show subtotal at the top of totals block. Which is I guess magento default functionality, but it is not appearing on my website Feb 12, 2020 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.