Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: Denote First Time Customer

Denote First Time Customer 23 Apr 2017 01:13 #1

Is there anyway to note a customers first order? ie normal order number would be 51516, 51517, 51518 etc. But if it is the customers first order on order 51517 the order number would be N51517.

I'm sure this is a little more custom, so if not an easy solution would you have a reference to anyone for hire for this kind of functionality?

Thanks!
The administrator has disabled public write access.

Denote First Time Customer 23 Apr 2017 15:32 #2

Dear Brickford5,
You are not the first one to request such functionality. Fortunately, I have already implemented a little extension for our plugin that provides an additional variable UserOrderCount:
open-tools.net/woocommerce/advanced-orde...rnumbers-for-wc.html

Please install that userordercount extension and enable it. This will prove the variable UserOrderCount for use in the number format and in the conditions for new variables/repleacements. Using this variable, you can define some custom number format for first-time orders:

If variable userordercount <= 1 THEN set variable ordernumber_format to N#|#

opentools_woocommerce_userordercount_variables.png


The variable userordercount will have value 0 for all orders from unregistered users (i.e. no new account created during the checkout) and value 1 for the first order of a registered customer.

The new ordernumber_format in my example above is "N#|#" and should in your case always have the form "N....|....", where .... is your exact ordernumber format. E.g. if you use an ordernumber format [year][month]-#, then the new format in your custom definition should be "#[year][month]-#|[year][month]-#". The repeated format after the | is required to force the counter to use the same counter as all other orders (i.e. ignore the N prefix in the order number). In particular, "N#|#" means: Display the number as N#, but let the counter increase as if the format were only #.
If you omit the |# part, then orders from new customers would have their own counter, which is probably not what you want.

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular