1

How can i add custom text block into cart summary? enter image description here

enter image description here

1

Create layout file: My\Module\view\frontend\layout\checkout_cart_index.xml and add the following 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>
        <referenceContainer name="cart.summary">
            <block name="summary.custom.block" class="My\Module\Block\Cart\CustomBlock"  template="cart/custom_block.phtml" before="checkout.cart.methods.bottom" />
        </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.