There is no invoice number generated by Zen Cart until AFTER the payment is completed. That's why it's passed blank.
But if you want to GUESS the order-number that will be assigned, you can add the following 2-part code:
1. Above the line where the array starts ... ie: above this line $submit_data_core = array(
Add this:
Code:
$last_order_id = $db->Execute("select orders_id from " . TABLE_ORDERS . " order by orders_id desc limit 1");
$new_order_id = $last_order_id->fields['orders_id'];
$new_order_id = ($new_order_id + 1);
// add randomized suffix to order id to produce uniqueness ... since it's unwise to submit the same order-number twice to authorize.net
$new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6, 'chars');
2. Then change:
Code:
'x_invoice_num' => ' ',
to:
Code:
'x_invoice_num' => $new_order_id,
Bookmarks