Magento 2 Move Shipping Information to Billing Step in Checkout – How to

checkoutlayoutmagento2uicomponent

How do I move the "Ship to:" and "Shipping Method:" sections from the order summary sidebar into the "Review & Payments" step of the checkout in Magento 2?

I know that as they are UI Components I'm not able to use <move element="" /> as I would with a normal block.

Best Answer

Both sections are contained in the shipping-information <item>.

Within my theme's checkout_index_index.xml file I was able to disable the component in the summary sidebar, and add it to the billing-step item, which represents the "Review & Payments" step in checkout.

I wanted it to appear at the top of this step above the payment method options so I also added the line <item name="sortOrder" xsi:type="string">0</item>.

My final code to achieve this:

<referenceContainer name="content">
    <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="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shipping-information" xsi:type="array">
                                                <item name="sortOrder" xsi:type="string">0</item>
                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-information</item>
                                                <item name="config" xsi:type="array">
                                                    <item name="deps" xsi:type="string">checkout.steps.shipping-step.shippingAddress</item>
                                                </item>
                                                <item name="displayArea" xsi:type="string">shipping-information</item>
                                                <item name="children" xsi:type="array">
                                                    <item name="ship-to" xsi:type="array">
                                                        <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-information/list</item>
                                                        <item name="displayArea" xsi:type="string">ship-to</item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                            <item name="sidebar" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-information" xsi:type="array">
                                        <item name="config" xsi:type="array">
                                            <item name="componentDisabled" xsi:type="boolean">true</item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</referenceContainer>