Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

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!

×

Notice

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

TOPIC:

Different order number for customer and admin 04 Nov 2017 20:32 #1

  • morbiusz
  • morbiusz's Avatar Topic Author
Hi
I am setting up your plugin on my website, but I am having small problem.
I have simple order number slug: LUK-[#]
And set global number to for example 1001
All works fine, order gets the number LUK-1001, admin get's an e-mail with confirmation and order number LUK-1001, but customer is getting e-mail with different order number: LUK-1002 - always incremented by 1.
How can I resolve it.
Also I am trying to use custom variables, if customer applies a coupon to an order I want different order slug - but it never works.
Attachments:

Different order number for customer and admin 12 Nov 2017 21:58 #2

Dear Morbiusz,
Sorry to hear about your issues.

Regarding your coupon issue: The coupon code is currently not available at all, so having different order number formats for order with and without a coupon is not possible.

The Issue with diverging order numbers in the the order confirmations mails to the customer and to the shop admin is something that I have not been able to reproduce on our test installations. Do you any plugins installed that might split the order into multiple sub-orders (e.g. Vendor plugins, multi-shipping plugins, etc.)?

Best regards,
Reinhold

Different order number for customer and admin 12 Nov 2017 23:46 #3

  • morbiusz
  • morbiusz's Avatar Topic Author
Hi Reinhold
If I am not able to different order numbers for order with and without coupon is it possible to ask for refund, as your plugin unfortunately doesn't do what I need it for. I though that your customisation feature will allow me to different by any available value connected to an order.

Different order number for customer and admin 19 Nov 2017 12:50 #4

Dear Morbiusz,
As I said, it is currently not possible with the released version, but it is quite simple to implement: In the file ordernumbers_woocommerce.php simply insert the following line at line 327:
		$reps["[coupons]"] = $order->get_used_coupons();
The resulting section should then look like:
[...]
		$reps["[skus]"] = array_keys($skus);
		$reps["[categories]"] = array_keys($categories);
		$reps["[tags]"] = array_keys($tags);
		$reps["[shippingclasses]"] = array_keys($shippingclasses);
		$reps["[vendors]"] = array_unique($vendors);
		$reps["[coupons]"] = $order->get_used_coupons();
	}

	public function setupUserReplacements (&$reps, $details, $nrtype) {
[...]

We will add this to our next release, so if you change your installed version, the next update would normally overwrite the changes. But as the next version will contain them already, an update will not break your installation.

Using this little change, you can assign different number formats (and thus also different counters) to orders with a coupon (any coupon) or to orders with a particular coupon. YOu would do this using custom variables.

a) To use a different number format if coupon with code "coupon1" (please note that internally, WC handles all coupon codes in lower-case!), simply use the following definition:
If variable coupons = coupon1 => Set variable ordernumber_format to value COUPON-#

b) To distinguish the case where no coupon was entered, you can compare the coupons variable with an empty value (meaning that the list of coupon codes is empty) as the condition in the custom variable.

So, the coupon feature should be possible with a tiny change to the plugin. Do you still want the refund?

Best regards.
Reinhold
  • Page:
  • 1