I need to show the MSRP price next to the regular price on the product view page in a Magento 2 site.
So it would be like:
$199 (MSRP: $399)
I have found this question: How to display MSRP / RRP on product page
The problem is I am lacking some pre-requisite knowledge to follow these instructions.
The theme I am using doesn't have a price.phtml
so I guess I need to override it from a module. I searched the vendor directory and found several price.phtml
files which is confusing to me. Which one do I override?
The theme I am using (Ultimo) has a custom catalog_product_view.xml
file which has this xml which I think refers to the part I want to edit:
<container name="product.info.price" label="Product info auxiliary container" htmlTag="div" htmlClass="product-info-price" after="product.info.review">
<container name="product.info.stock.sku" label="Product auxiliary info" htmlTag="div" htmlClass="product-info-stock-sku">
<container name="product.info.type" before="-"/>
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" template="product/view/attribute.phtml" after="product.info.type">
<arguments>
<argument name="at_call" xsi:type="string">getSku</argument>
<argument name="at_code" xsi:type="string">sku</argument>
<argument name="css_class" xsi:type="string">sku</argument>
<argument name="at_label" xsi:type="string">default</argument>
<argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
</arguments>
</block>
</container>
<block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="product/view/review.phtml" after="product.info.stock.sku" />
<block class="Magento\Catalog\Pricing\Render" name="product.price.final" after="product.info.sku">
<arguments>
<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>
</container>
So do I need to add something in to this xml for it to render the MSRP or do I need to edit something that it's already showing? I can't see which template is responsible for outputting price so does that mean the default magento 2 one is being used?
I am really struggling here to get a firm grip on how the system works and edit it in correct manner. Thanks for your help.