Magento: Get manufacturer name and id from product

Suppose, you have the product data, i.e. you have a loaded product information stored in a variable named ‘$_product‘. Now, when you type $_product->getManufacturer() , you will get the manufacturer ID. To get the manufacturer name, you have to use the following: $_product->getAttributeText(‘manufacturer’). Below is the complete code:

Get Manufacturer Name and ID from Product


/**
 * Load product by product id
 */
$_productId = YOUR_PRODUCT_ID; 
$_product = Mage::getModel('catalog/product')->load($_productId);

/**
 * Get manufacturer name
 */
$_manufacturerName = $_product->getAttributeText('manufacturer');

/**
 * Get manufacturer id
 */
$_manufacturerId = $_product->getManufacturer();

Hope it helps. Thanks.