Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Purchase Order version 1.2


olby

Recommended Posts

New version now online:

http://www.oscommerce.com/downloads.php/co...ions,795/type,1

 

This Purchase Order contribution is made for the new checkout procedure (Snapshot 9.th nov 2002).

 

It allows Your customers to do or enter the following text-information during checkout:

 

Selecting Purchase order as a payment method

Enter Account Name (Company Name)

Enter Account Number (The Account You have given your Customer)

Enter Purchase Order Number (Customers own reference)

 

This information is shown at:

 

Admin Orders Edit

Orders Confirmation E-mail (NEW in 1.2)

Account History Information - View Orders (NEW in 1.2)

 

Field po_number is changed from INT(10) to VARCHAR(12) (NEW in 1.2)

Best Regards

olby

Link to comment
Share on other sites

  • 3 weeks later...

Hi Kim

 

Yes jeg er dansk (I'm danish ;))

 

and yes I have installed dankort in a version that fit with the 2.2 version from before the new checkout.

 

Am going to upgrade in january.

Mail me if you're interested.

Best Regards

olby

Link to comment
Share on other sites

rart at se at man ikke der er den eneste dansker der skal eller skal til at bruge oscommerce !

 

Jeg kan hoste et forum... hvis der er tilslutning til dette !

 

Kim

Link to comment
Share on other sites

Hi Olby,

 

I just installed your po contribution - its great - but i'm having some problems. I'm also just starting php so bear with me..

 

Basically - as the user checks out - it looks fine.

 

2 major issues:

The po number is not updated in the database.

The email does not include the po numbers/name/account..

 

 

I tried hunting it down myself but I cant seem to find the error.

 

However, here is what I do know.

 

if above

 

 

sql_data_array = array('customers_id' => $customer_id,..

(around line 60...)

 

you add

 

$order->info['account_name']= somevalue;

 

that value is entered in the db properly. It also shows up under the admin section - but not through the customer order history page or the email.

 

My only real problem is that I am not sure where the value of

$order->info['account_name'] and the two other fields are assigned ..

 

 

is it in the before_process() function of a given payment module?

 

 

Thanks!

Link to comment
Share on other sites

Hi Mark.

 

1. po-number not updated:

Can relate to 2 files -

checkout_process.php - make sure that you don't have any typo's in this:

                          'comments' => $order->info['comments'], 

// purchaseorder start

                         'account_name' => $order->info['account_name'],

                         'account_number' => $order->info['account_number'],

                         'po_number' => $order->info['po_number'],

// purchaseorder end

                         'currency' => $order->info['currency'],

 

catalog/includes/classes/order.php - check these lines:

// purchaseorder added account_name, account_number, po_number

     $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, comments, currency, currency_value, account_name, account_number, po_number, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($order_id) . "'");

                          'comments' => $order['comments'],

// purchaseorder start

                         'account_name' => $order['account_name'],

                         'account_number' => $order['account_number'],

                         'po_number' => $order['po_number'],

// purchaseorder end

                          'cc_expires' => $GLOBALS['cc_expires'],

// purchaseorder start

                         'account_name' => $GLOBALS['account_name'],

                         'account_number' => $GLOBALS['account_number'],

                         'po_number' => $GLOBALS['po_number'],

// purchaseorder end

 

2. Not showing in email can relate to fields not being stored in the db, because I check for a value in the field account_name. Check the above listet code first, it might solve the problem for you.

If not, then e-mails are build in checkout_process.php, so make sure that you have this added:

    if ($payment_class->email_footer) { 

     $email_order .= $payment_class->email_footer . "nn";

// purchaseorder start

     if ($order->info['account_name']) {

       $email_order .= EMAIL_TEXT_ACCOUNT_NAME . $order->info['account_name'] . "n";

       $email_order .= EMAIL_TEXT_ACCOUNT_NUMBER . $order->info['account_number'] . "n";

       $email_order .= EMAIL_TEXT_PO_NUMBER . $order->info['po_number'] . "n";

     }

// purchaseorder end

This shows the information in the mail - IF account_name has a value!

 

If account_name has a value in the db for a given order, this code will show it in account_history.php:

<?php

// purchaseorder start

    if( (($order->info['account_name']) || ($order->info['account_number']) || ($order->info['po_number'])) ) {

?>

         <tr>

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_ACCOUNT_NAME; ?><br>

           <?php echo $order->info['account_name']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_ACCOUNT_NUMBER; ?><br>

           <?php echo $order->info['account_number']; ?></td>

         </tr>

         <tr>

           <td class="main"><?php echo ENTRY_PURCHASE_ORDER_NUMBER; ?><br>

           <?php echo $order->info['po_number']; ?></td>

         </tr>

<?php

// purchaseorder end

   }

?>

 

Don't worry about the po.php - they work, so the error must be somewhere in the above listet code.

 

HTH

Best Regards

olby

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...