I am trying to add custom attribute "publisher name" below product name in PDF invoice. Publisher is a custom attribute created by me.

I have copied




And have added some code in default.php but this is not working properly. It is showing attribute id like 250,251 in the pdf but I want it to show publisher name

I add following code in default.php

$Publisher = $this->getPublisherValue($item);

 $lines[1][] = array(
        'text'  => Mage::helper('core/string')->str_split($Publisher, 35),
        'feed'  => 35

private function getPublisherValue($item)
        $prod = Mage::getModel('catalog/product')->load($item->getProductId());

        if(($return_publisher = $prod->getPublisher()))
            return $return_publisher;
            return 'N/A';
  • what kind of attribute is publisher? is it an object or string or something else? without that I am not sure how much help we can be. May 1, 2015 at 18:51
  • 4
    I'm voting to close this question as off-topic because we need to know what type publisher is before we can help out. May 1, 2015 at 18:52
  • 250,251 looks like it's a varchar attribute with the table backend. Must be a multiselect due to the comma.
    – Agop
    May 1, 2015 at 19:42
  • I appologize for a stupid question, but where I need to specify the attribute that I need to retrieve? Sorry, newbie on the subject... Thanks. I have an attribute imgur.com/a/Og1dP
    – Artur Rain
    Apr 5, 2017 at 8:01

1 Answer 1


I guss that publisher is text type attribute

 /* if  check product is exit   */ 
 /* check getPublisher  value is null or not */
    return $return_publisher;
    return $prod->getPublisher();

return 'N/A';

If it dropdown attribute then use below code to get publisher label


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