How to show a drop down attribute output on product detail page in Magento

By | November 27, 2014

If you want to show a drop-down attribute value on product view page or product listing page in Magneto.

So, please use following code given below.

Suppose, your attribute code is “size”

So the code should be :

1) ON PRODUCT PAGE:

edit catalog/product/view.phtml and add :

1
<?php echo $_product->getResource()->getAttribute('size')->getFrontend()->getValue($_product) ?>

2) ON LIST/GRID PAGE:

edit catalog/product/list.phtml and add :

1
<?php echo $_product->getResource()->getAttribute('size')->getFrontend()->getValue($_product) ?>

Leave a Reply