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;
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
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.
add a comment |
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
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.
add a comment |
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
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
magento-1.9 invoice pdf
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.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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
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
|
show 13 more comments
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
);
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
|
show 13 more comments
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
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
|
show 13 more comments
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
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
edited Nov 3 '14 at 14:25
answered Nov 3 '14 at 7:59
Amit Bera♦Amit 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
|
show 13 more comments
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
|
show 13 more comments
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
);
add a comment |
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
);
add a comment |
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
);
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
);
answered Sep 23 '15 at 9:51
Anshu MishraAnshu Mishra
5,70652763
5,70652763
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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