I want to show two product custom attributes in product view page side by side the price with the same format (font size).
The attributes are PP and PR witch I created in Magento Admin and assign to the product.
Next I tried to put the code in list.phtml
to display the attributes:
I used
<?php echo 'PP ' . $_product->getData('pp') . ' PR ' . $_product->getData('pr'); ?>
But unfortunately I just can't retrieved the value of the attributes and it shows blank.
Could someone help me on this issue?
Best Answer
Try below code.
Also, check both attributes are
Visible on Catalog Pages on Storefront Used in Product Listing
.