5 replies [Last post]
Mariano's picture
Offline
Joined: 09/04/2007
Juice: 110
Was this information Helpful?

Hi.

I am trying to modify a little bit the 'Invoice print screen' at admin/store/orders/******/invoice/print.

There are a couple of custom fields at checkout in order to gather some required information. These fields are displayed at the 'View order' screen, as showed in the pic. I would like to pass these fields to the 'Invoice print screen', which I guess uses the customer template, or? I'm not sure how to do it, since I noticed most of the displayed fields at the printable invoice are shown by means of tokens (by the way, I somewhen found the list of available tokens, but can´t remember where it is...). Moreover, I would need to print the 'Payment' box too, which can be seen collapsed by the default at the 'View order' screen. How could I pass this box to the printable invoice as well?

Of course it is easy to just select the required text in order to print only that selection (directly from the 'View order' screen), but I would like to give it a try to the 'Printable invoice' screen if it is possible.

Thanks for any help =)

PreviewAttachmentSize
print.pngprint.png31.74 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Invoice Printing

If you're using a custom/modified customer invoice template, you can add anything to it using the fully loaded $order object... no need to use tokens. I just did that where possible b/c they were there.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
How to access data in $order

How do I access the values in the template for my custom fields? Can I access them at all in $order, or do I have to add tokens for them? I've tried $order->myfield and other variations, but I can't get them to display.

Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: How to access data in $order

Hmm... if you're implementing hook_order() in a module and loading up custom fields onto the order object, they should be there in the template. You might confirm that your values are actually being loaded to $order as expected elsewhere.

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
It's available on other panes

Well, the data is being loaded into the load op of hook_order, because it's available in the view and review ops on other panes.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: It's available on other panes

Hmm... then maybe make sure you're editing the right .itpl.php file and have configured the settings properly to point to that file. Puzzled