Ordernumbers for WooCommerce

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!



The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1


Order and Invoice numbers 17 May 2016 23:15 #1

  • entangledweb
  • entangledweb's Avatar Topic Author
I need the Order and Invoice numbers to be the same.

I am getting the correct Order number: #APR10920, however, in the Payment Gateway email it is shown as: Invoice Number: 36012.

Order and Invoice numbers 21 May 2016 00:00 #2

Dear EntangledWeb,
Which Payment Gateway are you using?

The situation you describe seems to indicate that the payment gateway does not actually use the order number of the order, but rather the post ID (which is the default for WooCommerce's order numbers, but WC has a trigger so that plugins can implement other order numbers -- apparently the payment gateway does not use that trigger).

My first guess would be that the Payment Gateway does not handle WC order numbers correctly. It should call $order->get_order_number() and NOT $order->get_id() to retrieve the order number for the given order... But that is just a guess from the symptoms you describe.

Best regards,

Order and Invoice numbers 26 May 2016 22:50 #3

  • entangledweb
  • entangledweb's Avatar Topic Author
That maybe so, here's the Authoirze.net Gateway plugin I am using:

Authorize.net for WooCommerce: wordpress.org/plugins/os-woocommerce-authorizenet-aim/

Would be nice to know what needs to be hacked to get the Order and Invoice number to be the same. I am also using:

MerchantOne Payment Gateway WooCommerce Addon: wordpress.org/plugins/webmicro-merchantone-woo-addon/

BitPay for WooCommerce: wordpress.org/plugins/bitpay-for-woocommerce/

And Coinbase Bitcoin: wordpress.org/plugins/coinbase-woocommerce/

Order and Invoice numbers 26 May 2016 23:16 #4

Dear EntangledWeb,
Thank you for the pointers. I took a quick look:

1. Authorize.net for WooCommerce:
Near the end of the file, the params that are sent to the payment gateway are defined, including the following:
'x_invoice_num'            => $order->id,
So, the authorize.net plugin for WooCommerce indeed assumes the invoice number to be the order ID (not even the order number). You might try to change this to $order->get_order_number(), but you'll need to do some testing (the payment gateway might expect a number rather than a string, which would break in your case).

2. MerchangeOne Payment Gateway for Woocommerce:
That plugin properly calls get_order_number() on the order:
	get_bloginfo('blogname').' Order #'.$wc_order->get_order_number(),
So I don't see any reason why this should not work as expected.

3. BitPay for WooCommerce:
That plugin also appears to correctly use the order number (and even set the order number for the invoice):
$order_number = $order->get_order_number();

4. Coinbase Bitcoin:
That plugin seems to use the order ID rather than the order number:
$params = array(
	'name'               => 'Order #' . $order_id,
	'price_string'       => $order->get_total(),
So, this Coinbase Bitcoin payment plugin also suffers from the same issue as the authorize.net plugin (both using the order ID rather than the order number).

Best regards,

Order and Invoice numbers 27 May 2016 20:25 #5

  • entangledweb
  • entangledweb's Avatar Topic Author
Thanks .. I'll hack at two "broken" ones.

As for the Authorize.net gateway, sending it a string is fine ... doing this already with another cart which basically as "Advanced Ordernumbers" built in.

[SOLVED] Order and Invoice numbers 01 Jun 2016 08:11 #6

Problem solved.
  • Page:
  • 1