0

I want to add the warehouse location (Custom attribute) as a column in each product in the PDF Invoice. I googled and i found exactly what i was looking for here! I think that the code its pretty outdated as it is from 2011 and maybe magento changed from then. I noticed that those files are now not located in /Model/Order/Pdf/... but in /Sales/Model/Order/Pdf/... My magento setup is some years old and i made some more changed in the PDF Invoice in the past so maybe that cause the problem. Anyway when trying to use this code and Print the invoice i receive the following error and i don't really get it. Can you please point me out?

Cannot send headers; headers already sent in /home/xxxxx/public_html/app/code/local/xxxxxx/WarehouseLocationToInvoice/Sales/Model/Order/Pdf/Invoice.php, line 1

Trace:
#0 /home/.../public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/.../public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(1065): Zend_Controller_Response_Abstract->setHeader('Pragma', 'public', true)
#2 /home/.../public_html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php(121): Mage_Core_Controller_Varien_Action->_prepareDownloadResponse('invoice2015-10-...', '%PDF-1.4\n%\xE2\xE3\xCF\xD3\n...', 'application/pdf')
#3 /home/.../public_html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489): Mage_Adminhtml_Controller_Sales_Invoice->printAction()
#4 /home/.../public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_InvoiceController->printAction()
#5 /home/.../public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('print')
#6 /home/.../public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /home/.../public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#8 /home/.../public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /home/.../public_html/index.php(83): Mage::run('', 'store')
#10 {main}

1 Answer 1

0

Ok i found the answer. I convert the File Encoding of those 2 files to "windows-1253" and its working fine now.

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.