0

Dears,

How can I add my custom block to cart summary page? I checked the checkout_cart_index.xml file but couldn't find exact location so could you guys provide me any solution?

enter image description here Thanks, Max

1

Please add below code to app/design/frontend/Themename/Themedirectory/Magento_Checkout/layout/checkout_cart_index.xml file

<referenceContainer name="checkout.cart.container">
    <block class="Magento\Framework\View\Element\Template" name="checkout.cart.content.block" after="-" template="Magento_Checkout::custom.phtml"/>
</referenceContainer>

I have tried this in my local and it's looking like this - https://prnt.sc/mbvoxm

Please check with clear your cache.

1

You can add below code to your custom theme layout or custom module layout

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="checkout.cart.items">
        <block class="Magento\Framework\View\Element\Template" name="checkout.cart.countdown" after="checkout.cart.crosssell" template="Magento_Checkout::yourcustomeTemplate"/>
    </referenceContainer>
</body>
</page>

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.