1

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

enter image description here

asked Feb 21, 2018 at 16:40

1 Answer 1

2

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>
answered Feb 23, 2018 at 10:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.