php - How to display newly added attributes in magento?
I added a new attribute inMagento
.
Attribute Label -> Weight Available
Attribute code -> weight_multi
input type -> multiple select
values are -> 1,1.5,2,2.5,3,3.5,4,4.5,5
Now I want toecho
theWeight Available
attribute in page.
To displayName
of the product we can useecho $_product->getName();
How to displayWeight Available
attribute?
$_product
object contain all product details.
But when I try
var_dump($_product->weight_multi);
This gives
string(26) "30,29,28,27,26,25,24,23,22"
This is strange the expected value is1,1.5,2,2.5,3,3.5,4,4.5,5
.
How can I resolve this?? And how to display the newly added attribute in page by code.
I triedecho $_product->getWeight_multi();
. But no luck..
I am using Magento 1.9.0.1.
Please help me...
Answer
Solution:
You can print value like this :
if you want to display attribute in product page. the go to admin panel -> catalog -> attributes ->manage attributes -> select your attribute to edit
there you will find "Visible on Product View Page on Front-end" set to yes then it will be displayed in product page.
check also in admin panel if there is any warning then refresh index and refresh cache.
Answer
Solution: