1

I want to show the cart totals section below the cart items on the checkout page.

enter image description here

3

You need to override your checkout_index_index.xml file and paste the below code :

<?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">

        <body>
            <referenceBlock name="checkout.root">
                <arguments>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="checkout" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="sidebar" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="summary" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="totals" xsi:type="array">
                                                        <item name="sortOrder" xsi:type="string">99</item>
                                                    </item>
                                                    <item name="cart_items" xsi:type="array">
                                                        <item name="sortOrder" xsi:type="string">0</item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </referenceBlock>
        </body>
    </page>

Clean cache and check the output.

Hope it'll helpful for you.

  • 1
    I will check and update you. thanks! – Masud Shaikh Feb 17 at 8:59
  • 1
    It is working. Thanks! – Masud Shaikh Feb 17 at 9:37
  • 1
    Happy coding !! :) – Rohan Hapani Feb 17 at 9:37
  • Also, I want to add a coupon code section in the order summary. Please let me know. – Masud Shaikh Feb 17 at 9:41
  • okay. will update you soon. – Rohan Hapani Feb 17 at 9:41
1

You have to extend the

vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml

in to your theme like

app/design/frontend/[Theme_Vendor]/[Theme]/Magento_Checkout/layout/checkout_index_index.xml

And add the below code.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="sidebar" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="summary" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="totals" xsi:type="array">
                                                    <item name="sortOrder" xsi:type="string">100</item>
                                                </item>
                                                <item name="cart_items" xsi:type="array">
                                                    <item name="sortOrder" xsi:type="string">0</item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Flush the cache and check, It works for me, Check the below screenshot.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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