Quote Originally Posted by 0be1 View Post
Can you please post the code that you inserted into header_php.php file so others can learn from your findings? I needed to do something similar and would like to see how this was resolved.

Thanks...

0be1

Sure No problem,

This method adds the P.O. Number field to the form so that it can be saved to the database in the order table, field name po_number If this P.O. Number is needed for a payment module for level 2 or 3 transaction, you'll need to modify the payment module to pull this information out.


in file /includes/modules/pages/checkout_confirmation/header_php.php
line 47, added

"//PO_number added by granville on 2007/12/10

if(isset($_POST['po_number'])) $_SESSION['po_number'] = zen_db_prepare_input($_POST['po_number']);"



to be able to save the p.o. number to the order in the database you have to do the following.
in file /includes/classes/order.php
line 54, added ",po_number"
line 123 added ",'po_number' => $order->fields['po_number']"
line 354 added ",'po_number' => (isset($_SESSION['po_number]) ? $_SESSION['po_number'] : '')"
line 615 added ",'po_number' => $_SESSION['po_number']"


the only thing I didn't do is to change the admin side to show the P.O. Number since I feel that the admin didn't need to know what the P.O. Number that the customer puts in. I imagine there could be a case where this would be needed, but I'm certain it's got to be easy to display it.