Home » Magento7 January 2010

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

Hope it helps. Thanks.

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • 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