In Magento 2.1 CE, luma theme, I'm trying to add a product attribute called "RRP" (Recommended Retail Price) and like to display it on the frontend product page and in catalog near the other prices. (Existing MSRP function isn't appropriate because i don't use MAP.)
I've added an price-attribute called "RRP" in backend, and there it's visible. In frontend, it's shown in "more information"-tab, but i like to show it near the other prices.
I've tried to call it in "vendor\magento\module-catalog\view\frontend\templates\product\list.phtml" with following code:
<?php echo $_product->getRrp(); ?>
but it's not visible.
Is this the right file and the right code to call the attribute? Or do i have to add something other to call the attribute in frontend?
But price is shown with 4 decimals, for example 10.0000 instead 10.00, and without currency symbol.
code i've used to show the attribute value:
<?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getRrp(), 'rrp') ?>
to show attribute label also, i've tried following code, but this doesn't work:
<?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getRrp(), 'rrp'); $_product->getResource()->getAttribute('rrp')->getStoreLabel() ?>
How i could add global currency format to the attribute? And how i could add the attribute label?