I have created a module which uses a Observer for the event 'checkout_onepage_controller_success_action'

I need to get the list of items in the order and get a custom attribute (the type is text).

So far I can load the order and get all items in that order:

$orderIds = $observer->getEvent()->getOrderIds();
$order = Mage::getModel('sales/order')->load($orderIds);
$ordered_items = $order->getAllItems();

So far to get some of the attributes for each item in the order I do this:

foreach ($ordered_items as $item) {
    echo $item->getName()."<br />";
    echo $item->getSku();

These values are displaying fine. The problem is each product has a custom attribute with the code 'isbn_10' but I can't get the value to display. Some code I've tried is:


Any help is much appreciated. Thanks.

2 Answers 2


Try with



$product = Mage::getModel('catalog/product')->load($item->getProductId())->getAttributeText('isbn_10');


$product = Mage::getModel('catalog/product')->load($item->getProductId())->getData('isbn_10');
  • Hi Marius, I've tried these two methods but both are still not displaying anything. Any other suggestions?
    – thairish
    Nov 29, 2013 at 11:06
  • @xx0f. I added an other suggestion. If that does not work, I'm out of ideas.
    – Marius
    Nov 29, 2013 at 11:44
  • The last one worked, many thanks for your help.
    – thairish
    Nov 29, 2013 at 11:54
  • I have been playing with Magento custom Attributes for last one year and I figured out a safest way to get custom attribute value. Here is the detailed tutorial scriptbaker.com/get-custom-attribute-value-in-magento Jun 22, 2014 at 19:15

To add to this question am trying to add a column inside the invoice file now by editing the following file I managed to get an output but I struggle with the correct value from the database:


    //draw Pick Location
    $lines[0][] = array(
        'text'  => Mage::helper('core/string')->str_split($this->getPickLocationValue($item), 25),
        'feed'  => 280,
        'align' => 'right'

and the function that seems to be the most important:

 * Return Value of custom attribute
 * */
private function getPickLocationValue($item)
    $product = Mage::getModel('catalog/product')->load($item->getProductId())->getAttributeText('picklocation');

    if(!($return_location = $item->getPickLocation()))
        return 'N/A';
        return $return_location;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.