6

I'm new to Magento 2 and would like to see if anybody could help me.

I need to show the product price in two different places on the product page. If a configurable product the price should render when an option is chosen to show the updated price based on the user's choice.

I have tried to duplicate the pricing block in catalog_product_view.xml

<block class="Magento\Catalog\Pricing\Render" name="custom.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>

This did not work does anybody know a way to do this?

Thanks

1

use below code and paste it in catalog_product_view.xml between <referenceContainer name="content"></referenceContainer>

<block class="Magento\Catalog\Pricing\Render" name="product.price.final_2" after="product.info.main">
                    <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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.