Quantcast
Channel: Doctor Magento » Programming
Viewing all articles
Browse latest Browse all 10

Show Magento Attributes on Frontend

$
0
0

If you have created custom magento attributes , then you might need to show them on frontend . So, here is how to call them to your frontend :

If custom attribute which you have created is textarea or textfield then add the following code

 ?php echo $_product-getAttributeName() ? 

for example If I created custom attribute with attribute code published_date then your code will be

 ?php echo $_product-getPublishedDate() ?

If custom attribute which you have created is a multiselect or a dropdown then add the following code

 ?php echo $_product-getAttributeText('published_date') ?

If you have done all this and still the value is not displaying, then edit the attribute and make sure, you have switched on the option, SHOW ON PRODUCT LISTING.

Article source: http://www.learnmagento.org/magento-tutorials/magento-attributes-on-frontend/


Viewing all articles
Browse latest Browse all 10

Trending Articles