Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento:how to get manufacturer name in Product page?

Tags:

magento

I want to display manufacturer name in product/view.phtml .I have all used all sort of functions like

<?php echo $_product->getAttributeText('manufacturer');?>
<?php echo $this->htmlEscape($_product->getData('manufacturer'));
<?php echo $_product->getData('manufacturer'); ?>

But none of them helped.So how to get manufacturer name in product view page .

like image 314
akt Avatar asked Sep 18 '12 05:09

akt


2 Answers

As mentioned above you will need to follow a few steps:

1) goto Attribute Sets, and make sure "manufacturer" is assigned to the attribute set you are using.

2) Make sure you have added some manufacturers into the attribute options.

3) Assign one of the options to your product.

Depending on your magento version this should work:

<?php echo $_product->getAttributeText('manufacturer') ?>

I can see the error you are getting:

gives error Call to a member function getManufacturer() on a non-object in 

Are you sure you are putting this code after this line:

<?php $_product = $this->getProduct(); ?>
like image 144
Andrew Avatar answered Oct 06 '22 22:10

Andrew


you can use something like this to get manufacture name

$_product->getResource()->getAttribute('manufacture')->getFrontend()->getValue($_product);
like image 22
Mufaddal Avatar answered Oct 07 '22 00:10

Mufaddal