cancel
Showing results for 
Search instead for 
Did you mean: 

add attributes to a product page

add attributes to a product page

I want to amend my product page to something similar to amazon. I am using Magento 2 with Ultimo theme and amazon sales channel. I wish to have five bullet points next to the main product image on my Magento store. I have created created some attributes to hold the bullet points. 


So I looking to find out;

How to show the attribute in a block

How to identify the block

1 REPLY 1

Re: add attributes to a product page

Hello @michaelgshaw 

 

Add the Attribute to the Block

You can add your attribute using the following methods:

If the block uses a .phtml file, you can access the attribute using the $product object.

in a product template file, such as view/frontend/templates/product/view.phtml

<?php
$attributeValue = $_product->getData('your_attribute_code');
?>
<p>Your Attribute: <?= $attributeValue ?></p>

 

Hope it helps ! 

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

 

 

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9