6

I want to position few blocks and containers in the checkout page. I am using a custom theme and create a checkout_cart_index.xml file.The file contents are

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">Shopping Cart</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="cart.summary" htmlClass="cart-summary clearafter">   
            <block class="Magento\Framework\View\Element\Template" name="cartbutton" template="Magento_Theme::cartbutton.phtml"/>    
            <move element="checkout.cart.shipping" before="-"/>
        </referenceContainer>
        <referenceBlock name="checkout.cart.summary.title" remove="true"/>


    </body>
</page>

But its not working. How can I do it?

6
<move element="checkout.cart.shipping" destination="cart.summary" before="-"/>

This link helps me.

how to change block ordering in layouts

| improve this answer | |
2

You can use move tags to move blocks. <move> instruction: allows changing element's order and parent.

<move element="logo" destination="login.header" before="-"/>

element: name of the current block/container.

destination: name of the destination block/container where you moving element.

before: name of the block before which you need to move your block.

after: name of the block after which you need to move your block.

Refer this for more information: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html

| improve this answer | |

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.