How to add custom product attribute in PDF invoice?getting problem in add custom product attribute in PDF invoice magento1.9Display custom attribute in invoice pdf magentoHow can I edit the custom options text in the created invoice PDF in Magento?getting problem in add custom product attribute in PDF invoice magento1.9Create invoice and shipment in magento via cron based on store view and order ageAdd Custom Attribute to PDF InvoiceMagento - Add order id to invoice PDFinvoice pdf add imageShopping cart is empty after cancel the payment in magento-1.9.1.1Magento Edit Order Invoice PDF - Options on Single LineCustom Invoice PDF

Corner spot where three faces meet

Confused by notation of atomic number Z and mass number A on periodic table of elements

Help to reproduce a tcolorbox with a decoration

What is the difference between `a[bc]d` (brackets) and `ab,cd` (braces)?

Is creating your own "experiment" considered cheating during a physics exam?

Will tsunami waves travel forever if there was no land?

Executing a stored procedure which selects and inserts into tables in SQL Server

Please, smoke with good manners

Can someone publish a story that happened to you?

Short story about a planet with two sentient species

Is DC-to-DC (24 V to 12 V) buck conversion typically more efficient than AC-to-DC (110 V to 12 V) conversion?

How do Bards prepare spells?

Any examples of headwear for races with animal ears?

What's the polite way to say "I need to urinate"?

What is the strongest case that can be made in favour of the UK regaining some control over fishing policy after Brexit?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

Why does processed meat contain preservatives, while canned fish needs not?

How to figure out whether the data is sample data or population data apart from the client's information?

French for 'It must be my imagination'?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Minimum value of 4 digit number divided by sum of its digits

Was there a Viking Exchange as well as a Columbian one?



How to add custom product attribute in PDF invoice?


getting problem in add custom product attribute in PDF invoice magento1.9Display custom attribute in invoice pdf magentoHow can I edit the custom options text in the created invoice PDF in Magento?getting problem in add custom product attribute in PDF invoice magento1.9Create invoice and shipment in magento via cron based on store view and order ageAdd Custom Attribute to PDF InvoiceMagento - Add order id to invoice PDFinvoice pdf add imageShopping cart is empty after cancel the payment in magento-1.9.1.1Magento Edit Order Invoice PDF - Options on Single LineCustom Invoice PDF






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to add custom attribute , product(book) publisher name below product name in PDF invoice(like in image)& publisher is custom attribute created by me.



I copied



app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php


to



app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php 
with following code in default.php


but this is not working



class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract

/**
* Draw item line
*/
public function draw()

$order = $this->getOrder();
$item = $this->getItem();
$pdf = $this->getPdf();
$page = $this->getPage();
$lines = array();
$Publisher = $this->getPublisherValue($item);


// draw Product name
$lines[0] = array(array(
'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
'feed' => 35,
));

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



// draw SKU
$lines[0][] = array(
'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17),
'feed' => 290,
'align' => 'right'
);

// draw QTY
$lines[0][] = array(
'text' => $item->getQty() * 1,
'feed' => 435,
'align' => 'right'
);

// draw item Prices
$i = 0;
$prices = $this->getItemPricesForDisplay();
$feedPrice = 395;
$feedSubtotal = $feedPrice + 170;
foreach ($prices as $priceData)
if (isset($priceData['label']))
// draw Price label
$lines[$i][] = array(
'text' => $priceData['label'],
'feed' => $feedPrice,
'align' => 'right'
);
// draw Subtotal label
$lines[$i][] = array(
'text' => $priceData['label'],
'feed' => $feedSubtotal,
'align' => 'right'
);
$i++;

// draw Price
$lines[$i][] = array(
'text' => $priceData['price'],
'feed' => $feedPrice,
'font' => 'bold',
'align' => 'right'
);
// draw Subtotal
$lines[$i][] = array(
'text' => $priceData['subtotal'],
'feed' => $feedSubtotal,
'font' => 'bold',
'align' => 'right'
);
$i++;


// draw Tax
$lines[0][] = array(
'text' => $order->formatPriceTxt($item->getTaxAmount()),
'feed' => 495,
'font' => 'bold',
'align' => 'right'
);

// custom options
$options = $this->getItemOptions();
if ($options)
foreach ($options as $option)
// draw options label
$lines[][] = array(
'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
'font' => 'italic',
'feed' => 35
);

if ($option['value'])
if (isset($option['print_value']))
$_printValue = $option['print_value'];
else
$_printValue = strip_tags($option['value']);

$values = explode(', ', $_printValue);
foreach ($values as $value)
$lines[][] = array(
'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
'feed' => 40
);





$lineBlock = array(
'lines' => $lines,
'height' => 20
);

$page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
$this->setPage($page);


private function getPublisherValue($item)

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

if(($return_publisher = $prod->getpublisher()))
return $return_publisher;
else
return 'N/A';











share|improve this question
















bumped to the homepage by Community 22 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    0















    I am trying to add custom attribute , product(book) publisher name below product name in PDF invoice(like in image)& publisher is custom attribute created by me.



    I copied



    app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php


    to



    app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php 
    with following code in default.php


    but this is not working



    class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract

    /**
    * Draw item line
    */
    public function draw()

    $order = $this->getOrder();
    $item = $this->getItem();
    $pdf = $this->getPdf();
    $page = $this->getPage();
    $lines = array();
    $Publisher = $this->getPublisherValue($item);


    // draw Product name
    $lines[0] = array(array(
    'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
    'feed' => 35,
    ));

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



    // draw SKU
    $lines[0][] = array(
    'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17),
    'feed' => 290,
    'align' => 'right'
    );

    // draw QTY
    $lines[0][] = array(
    'text' => $item->getQty() * 1,
    'feed' => 435,
    'align' => 'right'
    );

    // draw item Prices
    $i = 0;
    $prices = $this->getItemPricesForDisplay();
    $feedPrice = 395;
    $feedSubtotal = $feedPrice + 170;
    foreach ($prices as $priceData)
    if (isset($priceData['label']))
    // draw Price label
    $lines[$i][] = array(
    'text' => $priceData['label'],
    'feed' => $feedPrice,
    'align' => 'right'
    );
    // draw Subtotal label
    $lines[$i][] = array(
    'text' => $priceData['label'],
    'feed' => $feedSubtotal,
    'align' => 'right'
    );
    $i++;

    // draw Price
    $lines[$i][] = array(
    'text' => $priceData['price'],
    'feed' => $feedPrice,
    'font' => 'bold',
    'align' => 'right'
    );
    // draw Subtotal
    $lines[$i][] = array(
    'text' => $priceData['subtotal'],
    'feed' => $feedSubtotal,
    'font' => 'bold',
    'align' => 'right'
    );
    $i++;


    // draw Tax
    $lines[0][] = array(
    'text' => $order->formatPriceTxt($item->getTaxAmount()),
    'feed' => 495,
    'font' => 'bold',
    'align' => 'right'
    );

    // custom options
    $options = $this->getItemOptions();
    if ($options)
    foreach ($options as $option)
    // draw options label
    $lines[][] = array(
    'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
    'font' => 'italic',
    'feed' => 35
    );

    if ($option['value'])
    if (isset($option['print_value']))
    $_printValue = $option['print_value'];
    else
    $_printValue = strip_tags($option['value']);

    $values = explode(', ', $_printValue);
    foreach ($values as $value)
    $lines[][] = array(
    'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
    'feed' => 40
    );





    $lineBlock = array(
    'lines' => $lines,
    'height' => 20
    );

    $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
    $this->setPage($page);


    private function getPublisherValue($item)

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

    if(($return_publisher = $prod->getpublisher()))
    return $return_publisher;
    else
    return 'N/A';











    share|improve this question
















    bumped to the homepage by Community 22 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      0












      0








      0


      2






      I am trying to add custom attribute , product(book) publisher name below product name in PDF invoice(like in image)& publisher is custom attribute created by me.



      I copied



      app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php


      to



      app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php 
      with following code in default.php


      but this is not working



      class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract

      /**
      * Draw item line
      */
      public function draw()

      $order = $this->getOrder();
      $item = $this->getItem();
      $pdf = $this->getPdf();
      $page = $this->getPage();
      $lines = array();
      $Publisher = $this->getPublisherValue($item);


      // draw Product name
      $lines[0] = array(array(
      'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
      'feed' => 35,
      ));

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



      // draw SKU
      $lines[0][] = array(
      'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17),
      'feed' => 290,
      'align' => 'right'
      );

      // draw QTY
      $lines[0][] = array(
      'text' => $item->getQty() * 1,
      'feed' => 435,
      'align' => 'right'
      );

      // draw item Prices
      $i = 0;
      $prices = $this->getItemPricesForDisplay();
      $feedPrice = 395;
      $feedSubtotal = $feedPrice + 170;
      foreach ($prices as $priceData)
      if (isset($priceData['label']))
      // draw Price label
      $lines[$i][] = array(
      'text' => $priceData['label'],
      'feed' => $feedPrice,
      'align' => 'right'
      );
      // draw Subtotal label
      $lines[$i][] = array(
      'text' => $priceData['label'],
      'feed' => $feedSubtotal,
      'align' => 'right'
      );
      $i++;

      // draw Price
      $lines[$i][] = array(
      'text' => $priceData['price'],
      'feed' => $feedPrice,
      'font' => 'bold',
      'align' => 'right'
      );
      // draw Subtotal
      $lines[$i][] = array(
      'text' => $priceData['subtotal'],
      'feed' => $feedSubtotal,
      'font' => 'bold',
      'align' => 'right'
      );
      $i++;


      // draw Tax
      $lines[0][] = array(
      'text' => $order->formatPriceTxt($item->getTaxAmount()),
      'feed' => 495,
      'font' => 'bold',
      'align' => 'right'
      );

      // custom options
      $options = $this->getItemOptions();
      if ($options)
      foreach ($options as $option)
      // draw options label
      $lines[][] = array(
      'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
      'font' => 'italic',
      'feed' => 35
      );

      if ($option['value'])
      if (isset($option['print_value']))
      $_printValue = $option['print_value'];
      else
      $_printValue = strip_tags($option['value']);

      $values = explode(', ', $_printValue);
      foreach ($values as $value)
      $lines[][] = array(
      'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
      'feed' => 40
      );





      $lineBlock = array(
      'lines' => $lines,
      'height' => 20
      );

      $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
      $this->setPage($page);


      private function getPublisherValue($item)

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

      if(($return_publisher = $prod->getpublisher()))
      return $return_publisher;
      else
      return 'N/A';











      share|improve this question
















      I am trying to add custom attribute , product(book) publisher name below product name in PDF invoice(like in image)& publisher is custom attribute created by me.



      I copied



      app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php


      to



      app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php 
      with following code in default.php


      but this is not working



      class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_Order_Pdf_Items_Abstract

      /**
      * Draw item line
      */
      public function draw()

      $order = $this->getOrder();
      $item = $this->getItem();
      $pdf = $this->getPdf();
      $page = $this->getPage();
      $lines = array();
      $Publisher = $this->getPublisherValue($item);


      // draw Product name
      $lines[0] = array(array(
      'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
      'feed' => 35,
      ));

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



      // draw SKU
      $lines[0][] = array(
      'text' => Mage::helper('core/string')->str_split($this->getSku($item), 17),
      'feed' => 290,
      'align' => 'right'
      );

      // draw QTY
      $lines[0][] = array(
      'text' => $item->getQty() * 1,
      'feed' => 435,
      'align' => 'right'
      );

      // draw item Prices
      $i = 0;
      $prices = $this->getItemPricesForDisplay();
      $feedPrice = 395;
      $feedSubtotal = $feedPrice + 170;
      foreach ($prices as $priceData)
      if (isset($priceData['label']))
      // draw Price label
      $lines[$i][] = array(
      'text' => $priceData['label'],
      'feed' => $feedPrice,
      'align' => 'right'
      );
      // draw Subtotal label
      $lines[$i][] = array(
      'text' => $priceData['label'],
      'feed' => $feedSubtotal,
      'align' => 'right'
      );
      $i++;

      // draw Price
      $lines[$i][] = array(
      'text' => $priceData['price'],
      'feed' => $feedPrice,
      'font' => 'bold',
      'align' => 'right'
      );
      // draw Subtotal
      $lines[$i][] = array(
      'text' => $priceData['subtotal'],
      'feed' => $feedSubtotal,
      'font' => 'bold',
      'align' => 'right'
      );
      $i++;


      // draw Tax
      $lines[0][] = array(
      'text' => $order->formatPriceTxt($item->getTaxAmount()),
      'feed' => 495,
      'font' => 'bold',
      'align' => 'right'
      );

      // custom options
      $options = $this->getItemOptions();
      if ($options)
      foreach ($options as $option)
      // draw options label
      $lines[][] = array(
      'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
      'font' => 'italic',
      'feed' => 35
      );

      if ($option['value'])
      if (isset($option['print_value']))
      $_printValue = $option['print_value'];
      else
      $_printValue = strip_tags($option['value']);

      $values = explode(', ', $_printValue);
      foreach ($values as $value)
      $lines[][] = array(
      'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
      'feed' => 40
      );





      $lineBlock = array(
      'lines' => $lines,
      'height' => 20
      );

      $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
      $this->setPage($page);


      private function getPublisherValue($item)

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

      if(($return_publisher = $prod->getpublisher()))
      return $return_publisher;
      else
      return 'N/A';








      magento-1.9 invoice pdf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 12 '17 at 12:41









      Manoj Deswal

      4,38591744




      4,38591744










      asked Nov 3 '14 at 7:46









      DineshDinesh

      40941431




      40941431





      bumped to the homepage by Community 22 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 22 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          2 Answers
          2






          active

          oldest

          votes


















          0














          dinesh You can get all product attribute value from sale order item So you need to load Product from Product object Mage::getModel('catalog/product') by $item->getProductId();



           $product=Mage::getModel('catalog/product')->load($item->getProductId());
          if($product->getId())
          /* product is exiting in magento
          $publisher=$product->getPublisher();
          else
          /* product has been deleted from magento so you can not get product data */

          $publisher='None';


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


          $product is give when this product is exiting magento because magento do not save product publisher attribute in sales_flat_order_item






          share|improve this answer

























          • i try this not working when i click print show blank page & no pdf is generated

            – Dinesh
            Nov 3 '14 at 8:20











          • check this and what attribute code of publisher?

            – Amit Bera
            Nov 3 '14 at 8:22











          • try this also but same problem

            – Dinesh
            Nov 3 '14 at 8:28











          • what is your attribute code of attribute

            – Amit Bera
            Nov 3 '14 at 9:46











          • how to get a attribute code of attribute

            – Dinesh
            Nov 3 '14 at 10:33


















          0














          You can try below code.


          Rewrite class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default

          Override method public function draw()

          Add below in the function



          $newAttr = $productObject->getAttributeText('attribute_code');
          $lines[][] = array(
          'text' => Mage::helper('core/string')->str_split('Style : ' . $newAttr, 60, true, true),
          'font' => 'italic',
          'feed' => 35
          );





          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f42250%2fhow-to-add-custom-product-attribute-in-pdf-invoice%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            dinesh You can get all product attribute value from sale order item So you need to load Product from Product object Mage::getModel('catalog/product') by $item->getProductId();



             $product=Mage::getModel('catalog/product')->load($item->getProductId());
            if($product->getId())
            /* product is exiting in magento
            $publisher=$product->getPublisher();
            else
            /* product has been deleted from magento so you can not get product data */

            $publisher='None';


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


            $product is give when this product is exiting magento because magento do not save product publisher attribute in sales_flat_order_item






            share|improve this answer

























            • i try this not working when i click print show blank page & no pdf is generated

              – Dinesh
              Nov 3 '14 at 8:20











            • check this and what attribute code of publisher?

              – Amit Bera
              Nov 3 '14 at 8:22











            • try this also but same problem

              – Dinesh
              Nov 3 '14 at 8:28











            • what is your attribute code of attribute

              – Amit Bera
              Nov 3 '14 at 9:46











            • how to get a attribute code of attribute

              – Dinesh
              Nov 3 '14 at 10:33















            0














            dinesh You can get all product attribute value from sale order item So you need to load Product from Product object Mage::getModel('catalog/product') by $item->getProductId();



             $product=Mage::getModel('catalog/product')->load($item->getProductId());
            if($product->getId())
            /* product is exiting in magento
            $publisher=$product->getPublisher();
            else
            /* product has been deleted from magento so you can not get product data */

            $publisher='None';


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


            $product is give when this product is exiting magento because magento do not save product publisher attribute in sales_flat_order_item






            share|improve this answer

























            • i try this not working when i click print show blank page & no pdf is generated

              – Dinesh
              Nov 3 '14 at 8:20











            • check this and what attribute code of publisher?

              – Amit Bera
              Nov 3 '14 at 8:22











            • try this also but same problem

              – Dinesh
              Nov 3 '14 at 8:28











            • what is your attribute code of attribute

              – Amit Bera
              Nov 3 '14 at 9:46











            • how to get a attribute code of attribute

              – Dinesh
              Nov 3 '14 at 10:33













            0












            0








            0







            dinesh You can get all product attribute value from sale order item So you need to load Product from Product object Mage::getModel('catalog/product') by $item->getProductId();



             $product=Mage::getModel('catalog/product')->load($item->getProductId());
            if($product->getId())
            /* product is exiting in magento
            $publisher=$product->getPublisher();
            else
            /* product has been deleted from magento so you can not get product data */

            $publisher='None';


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


            $product is give when this product is exiting magento because magento do not save product publisher attribute in sales_flat_order_item






            share|improve this answer















            dinesh You can get all product attribute value from sale order item So you need to load Product from Product object Mage::getModel('catalog/product') by $item->getProductId();



             $product=Mage::getModel('catalog/product')->load($item->getProductId());
            if($product->getId())
            /* product is exiting in magento
            $publisher=$product->getPublisher();
            else
            /* product has been deleted from magento so you can not get product data */

            $publisher='None';


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


            $product is give when this product is exiting magento because magento do not save product publisher attribute in sales_flat_order_item







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 3 '14 at 14:25

























            answered Nov 3 '14 at 7:59









            Amit BeraAmit Bera

            60.3k1678178




            60.3k1678178












            • i try this not working when i click print show blank page & no pdf is generated

              – Dinesh
              Nov 3 '14 at 8:20











            • check this and what attribute code of publisher?

              – Amit Bera
              Nov 3 '14 at 8:22











            • try this also but same problem

              – Dinesh
              Nov 3 '14 at 8:28











            • what is your attribute code of attribute

              – Amit Bera
              Nov 3 '14 at 9:46











            • how to get a attribute code of attribute

              – Dinesh
              Nov 3 '14 at 10:33

















            • i try this not working when i click print show blank page & no pdf is generated

              – Dinesh
              Nov 3 '14 at 8:20











            • check this and what attribute code of publisher?

              – Amit Bera
              Nov 3 '14 at 8:22











            • try this also but same problem

              – Dinesh
              Nov 3 '14 at 8:28











            • what is your attribute code of attribute

              – Amit Bera
              Nov 3 '14 at 9:46











            • how to get a attribute code of attribute

              – Dinesh
              Nov 3 '14 at 10:33
















            i try this not working when i click print show blank page & no pdf is generated

            – Dinesh
            Nov 3 '14 at 8:20





            i try this not working when i click print show blank page & no pdf is generated

            – Dinesh
            Nov 3 '14 at 8:20













            check this and what attribute code of publisher?

            – Amit Bera
            Nov 3 '14 at 8:22





            check this and what attribute code of publisher?

            – Amit Bera
            Nov 3 '14 at 8:22













            try this also but same problem

            – Dinesh
            Nov 3 '14 at 8:28





            try this also but same problem

            – Dinesh
            Nov 3 '14 at 8:28













            what is your attribute code of attribute

            – Amit Bera
            Nov 3 '14 at 9:46





            what is your attribute code of attribute

            – Amit Bera
            Nov 3 '14 at 9:46













            how to get a attribute code of attribute

            – Dinesh
            Nov 3 '14 at 10:33





            how to get a attribute code of attribute

            – Dinesh
            Nov 3 '14 at 10:33













            0














            You can try below code.


            Rewrite class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default

            Override method public function draw()

            Add below in the function



            $newAttr = $productObject->getAttributeText('attribute_code');
            $lines[][] = array(
            'text' => Mage::helper('core/string')->str_split('Style : ' . $newAttr, 60, true, true),
            'font' => 'italic',
            'feed' => 35
            );





            share|improve this answer



























              0














              You can try below code.


              Rewrite class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default

              Override method public function draw()

              Add below in the function



              $newAttr = $productObject->getAttributeText('attribute_code');
              $lines[][] = array(
              'text' => Mage::helper('core/string')->str_split('Style : ' . $newAttr, 60, true, true),
              'font' => 'italic',
              'feed' => 35
              );





              share|improve this answer

























                0












                0








                0







                You can try below code.


                Rewrite class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default

                Override method public function draw()

                Add below in the function



                $newAttr = $productObject->getAttributeText('attribute_code');
                $lines[][] = array(
                'text' => Mage::helper('core/string')->str_split('Style : ' . $newAttr, 60, true, true),
                'font' => 'italic',
                'feed' => 35
                );





                share|improve this answer













                You can try below code.


                Rewrite class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default

                Override method public function draw()

                Add below in the function



                $newAttr = $productObject->getAttributeText('attribute_code');
                $lines[][] = array(
                'text' => Mage::helper('core/string')->str_split('Style : ' . $newAttr, 60, true, true),
                'font' => 'italic',
                'feed' => 35
                );






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 23 '15 at 9:51









                Anshu MishraAnshu Mishra

                5,70652763




                5,70652763



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f42250%2fhow-to-add-custom-product-attribute-in-pdf-invoice%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2