Jump to content


Corporate Sponsors


Latest News: (loading..)

RC2a - No Invoice # - Why not?


  • You cannot reply to this topic
3 replies to this topic

#1 Sethman

  • Community Member
  • 283 posts
  • Real Name:Sethman
  • Location:Salt Lake City, UT

Posted 15 August 2008, 05:12

I have installed a fresh RC2a and run the Authorize.net AIM payment module. Everything works just fine, but the invoice # is missing from the order. Does anyone know how to fix this so that it passes that information?

#2 RookuhShay

  • Community Member
  • 12 posts
  • Real Name:Mike

Posted 15 August 2008, 22:46

In the Payment module authorizenet_cc_aim.php find the function function before_process()

Add

// Calculate the next expected order id
$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
$last_inv = tep_db_fetch_array($last_order_id);
$new_order_id = $last_inv['orders_id'] + 1;

Just after line

global $HTTP_POST_VARS, $customer_id, $order, $sendto, $currency;

Near the top.

Then Add line:

x_invoice_num => $new_order_id,

Just after lines:

x_phone => $order->customer['telephone'],
x_email => $order->customer['email_address'],
x_cust_id => $_SESSION['customer_id'],

in the same function.

Enjoy,

RookuhShay

#3 Sethman

  • Community Member
  • 283 posts
  • Real Name:Sethman
  • Location:Salt Lake City, UT

Posted 16 August 2008, 11:25

Thank you! Works wonders! I had the right idea, just couldn't get my syntax right. ;)

#4 robinwarren

  • Community Member
  • 9 posts
  • Real Name:Robin Warren

Posted 16 September 2008, 16:05

:rolleyes: This worked perfectly. Thank you thank you! The OSCommerce forum is awesome!