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.
2 Answers 2
After some research, I found out that the referenceContainer for this is additional.product.info
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.
Explore related questions
See similar questions with these tags.