How to get Product attibute name of a specific product in magento

In my running project I faced a problem to print product attribute value for a specific product with product name and SKU. lastly it is solved here is solution so i liked to share it.


<h5><?php echo $this->htmlEscape($_item->getName()) ?></h5> // for product name
 <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div> // for SKU
<h5>

<?php

$_prod = Mage::getModel('catalog/product')->load($_item->getProductId());

?>

<?php
//echo $_prod->getDropshipper(); // for printing attribute ID
?>

<h5>Drop Shipper : <?php echo $_prod->getAttributeText('dropshipper')?>  </h5> // for pribting attribute value's name

so enjoy magento

for more magento tutorial visit: http://blog.free-extension.com/

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: