Monday 14 January 2013

Get custom attribute value in magento admin orders

with this code you can get any custom attribute value in magento admin order section , you can show only in admin or in frontend depends upon your need
   

 <div style="color: black; font-size: 14px; font-weight: bold;">proviser <span><?php $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $_item->getSku(), array('provider')); echo $product->getprovider(); ?>  </span>  </div>

in above code just replace your attribute code which you specify in admin for that like for my case i use "provider "
just replace provider with your attribute code and place this in your 

/public_html/app/design/adminhtml/default/default/template/sales/items/column/name.phtml file   

4 comments:

  1. Is it possible to use this with a specific product at the cart level?

    ReplyDelete
  2. can you please brief your question

    ReplyDelete
  3. Perfect, very simple and useful, thanks

    ReplyDelete
  4. Good work rohet goel,
    In order to add the custom order attributes in Magento, I use FME Additional Checkout Attributes extension which lets you collect all the required fields right on the checkout page.

    Demo: https://www.fmeextensions.com/magento-additional-checkout-attributes-fields.html

    ReplyDelete