I want to add static text above the price. I tried to add as explained in the thread (Magento 2: How to add text within container via XML) but it didn't work for me.
<referenceContainer name="product.info.main">
<block class="Magento\Catalog\Pricing\Render" name="product.price.final" before="product.price.tier">
<arguments>
<argument translate="true" name="text" xsi:type="string">Mytext</argument>
<argument name="price_render" xsi:type="string">product.price.render.default</argument>
<argument name="price_type_code" xsi:type="string">final_price</argument>
<argument name="zone" xsi:type="string">item_view</argument>
</arguments>
</block>
</referenceContainer>
Emipro Technologies Pvt. Ltd.
4,1232 gold badges31 silver badges65 bronze badges
asked Jan 31, 2017 at 7:33
Jarnail S
4,70730 gold badges47 silver badges80 bronze badges
1 Answer 1
This would add your static text block above the price.
<referenceContainer name="product.info.main">
<block class="Magento\Framework\View\Element\Text" name="your.block.name" before="product.info.price">
<arguments>
<argument name="text" xsi:type="string"><![CDATA[<div>Content of your block.</div>]]></argument>
</arguments>
</block>
</referenceContainer>
answered Jan 31, 2017 at 9:26
Rendy Eko Prastiyo
1,4798 silver badges16 bronze badges
Explore related questions
See similar questions with these tags.
default
<action>tag ?