Magento 2 Checkout Summary Section Sort Order.

We will add sort order to summary section. we will move item section before totals with use of totals on checkout page.

First of all we will need to override layout file in our theme as i am giving you example.

checkout_index_index.xml we will override in our theme.

As a second step we need to add layout rearrangement as we given below.

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

Clear cache and deploy static content deploy and refresh the page.

Thats it...!!! Have a noce day...!!!

Experienced Magento Certified Developer with a demonstrated history of working in the information technology and services industry. Skilled in SQL, PHP, XAMPP, jQuery, and Microsoft Office. Strong engineering professional with a Master of Computer Applications

0 comments:

Post a Comment

Popular Posts

Have You Any Questins Let Us Know.

Contact Us
DENISH VACHHANI
Ahmedabad India