0

I want to insert my custom block in checkout_cart_index.xml page below the product name. But I do not know the name of that referenceContainer. What I want to achieve is, if any product is added in cart, then there will be a custom block rendered below their product name.

asked Aug 23, 2022 at 5:39

2 Answers 2

1

After some research, I found out that the referenceContainer for this is additional.product.info

answered Aug 23, 2022 at 6:08
0

Please try this code :

Create checkout_index_index.xml

<?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="content">
 <block class="Magento\Framework\View\Element\Template" name="custom_text_summary"
 template="Vendor_Module::checkout/your_phtml.phtml"/>
 </referenceContainer>
 </body>
</page>

And call static block in phtml.

And create summary.html in this path view\frontend\web\template\checkout.

<!-- Custom Text -->
<tr class="grand totals">
 <td class="myClass" colspan="2">
 <span data-bind="html: customText"></span>
 </td>
</tr>

And add your code like this in summary.html

here customText is your bind data, which you have to define in your phtml first.

answered Aug 23, 2022 at 9:19

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.