Magento Forum

   
Editing Invoice Appearance (PDF)
 
AlexUser
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-03-10
 

Hello All,

I have a question about the PDF Invoices. I want to deploy to start deploying Magento but the Invoices it generates look pretty weak. How would i go about editing them or changing their appearance ? Any pointers would be great.

Regards Alex

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlexUser
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-03-10
 

Can anyone shed any light on this.

I assume people who are using this on live stores have either edited the invoices or export and use another system. Any help would be truly appreciated.

Alex

 
Magento Community Magento Community
Magento Community
Magento Community
 
ahri
Jr. Member
 
Total Posts:  21
Joined:  2008-03-29
 

I have the same questio. I don’t find yet where to modify it :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlexUser
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-03-10
 

Has anyone managed to work this out. What are people with live stores doing as the default looks terrible ?

Alex

 
Magento Community Magento Community
Magento Community
Magento Community
 
John
Sr. Member
 
Avatar
Total Posts:  129
Joined:  2007-12-20
Sheffield, United Kingdom
 

I know the answer is to override the Abstract.php and Invoice.php in Sales/Model/Order/Pdf/ but not got to that yet.  On the list though so I will share once I know.

Regards
John

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlexUser
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-03-10
 

Thats really helpful will take a look now. Alex

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

Actually editing the Invoices aren’t that difficult.  There is a template file (I believe under Sales section in a folder called PDF) that has all the calls that you need to edit it.  It is based off of Zend PDF framework so you can take a look at that for the function calls.  I would say give that a look.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
John
Sr. Member
 
Avatar
Total Posts:  129
Joined:  2007-12-20
Sheffield, United Kingdom
 

Hi - I am now at the stage where I am looking to move the client Invoice/Credit Note/… up to the client current design and look.  I have a question about overloading the Abstract..

I have already overloaded the app/code/core/Mage/Sales/Model/Order/Pdf/invoice.php file using the normal overload and below is the config.xml that I am using to overload the invoice.php file (Mage_Sales_Model_Order_Pdf_Invoice)

<global>
     <
models>
        <
sales>
            <
rewrite>
                <
order_pdf_invoice>Charlie_Sales_Model_Order_Pdf_Invoice</order_pdf_invoice
            </
rewrite>
        </
sales>
     </
models>
</global>

This works great… now most of the code I need to change is in the Abstract.php..!

Does anyone know how to do this?  I have tried the obvious (below) but that did not work - nor did it seem right.

<order_pdf_abstract>Charlie_Sales_Model_Order_Pdf_Abstract</order_pdf_abstract>

The problem seems to be that Abstract is not called via a Mage::getModel(....) call but is an inherited class. - Do I have to overload the whole class structure and if so has anyone any idea how to do this?

Thanks for your time
John

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top