Home » Magento

Magento: Get manufacturer name and id from product

7 January 2010 Share/Bookmark

Suppose, you have the product data.

You can get product from either of the following way:-

$_product = $this->getProduct();

OR,

$_product = Mage::getModel('catalog/product')->load(PRODUCT_ID);

Now, here is the code to get manufacturer name and id.

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

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

From Mukesh Chapagain's Blog, post Magento: Get manufacturer name and id from product

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed
  • http://serv01.siteground175.com/~inhausde/index.php/gold-leaf-embroidery.html Bill

    Hi Mukesh,
    Looks like I’m getting really close with your helpful tutorials. I have a store that has mostly fabric with a product qty at decimals (like .25). But there are some products with attribute values as “specialty” and “notions” that need to have a qty of 1,2,3, etc.
    The If statement below converts the entire site to decimals, I need to exclude the two values of “specialty” and “notions” how do I add the results of your “get” statement to this “if” statement? Or am I doing it all wrong?

    getAttributeText(‘notions’); ?>

    parent_id == 5)) || ($color != “”) || ($designer != “”)) { ?>

  • Jon

    Hi!
    This works great. However I need to find out the ID.
    I’m trying to implement a product unit(e.g pcs, kg) in the order management.

    I’m altering the default.phtml in sales/order/view/items/renderer/.

    The script gets all info about the current item from:
    getItem() ?>

    But I can’t figure out how to get the ID.

    Thanks,
    Jon