Show Po Number On Invoice

I have a payment method set up called "Invoice" that uses the po.tpl template, and asks for a PO Number, Name, and Position. I am trying to figure out how to show the PO number that a user entered during checkout on the invoice. I am using version 4.7.1 and have the email templates enabled so that I can edit them via admin. I clicked on Documents, Invoice, and am editing the invoice contents, but I cannot find any field that contains the PO Number. Even when I open up the actual database, I can't find the PO number in any of the tables or fields. Can someone please tell me what variable I can use to show it on the invoice? I would think it would be something in the payment variable, right?

Thank you!


You might see it as {{$order_info.payment_info.po_number}}. Not sure of the syntax for the new editor. But payment_info should be there in its entirety. Other order fields are hard coded as to which are available.

Has anyone figured out how to do this with the new editor? As Colleen said, the PO Number doesn't exist as a variable to use when you expand the parent 'payment' variable. One would expect that this would be the format {{p.po_number}} but that doesn't work.

Any ideas?

Hi Unfortunately it is not pissoble without some extra coding.

What you should do is change this file: app/Tygh/Template/Document/Order/Variables/OrderVariable.php

Just add these lines:

            'payment_info' => array(
                'po_number', 'company_name', 'buyer_name', 'position'

After this code:

            'raw' => array(
                'timestamp', 'notes', 'display_subtotal', 'discount', 'subtotal_discount', 'payment_surcharge',
                'display_shipping_cost', 'total'

After this you should be able to see payment_info variable in the order_info values, like this:

Just click on the required variable and it will be added to the document:

Hope this will help.

Awesome! That worked out great. Appreciate your assistance on this one.