Hey guys,
love commerce its a great work! thanks to commerce guys!
there´s only one thing at the moment what I can´t get to work.
I need an additional customer and order number like "3-0001" for the first customer and "3-0001-0001" for his first order so the second customer is "3-0002" and his first order "3-0002-0001"
I setted up another textfield for user (field_customer_number) which i made readonly thru hook_form_alter
then i made a new rule "after saving a new commerce order" which will create the customer number if the field is empty, so only real customers get a customer number not every user, so far so good.
Had a problem with anonymous orders but I think I can handle this now.
Anyway the data I´m inserting at the moment is "3-[commerce-order:uid]"
but thats not exactly what i want to do, cause as i said the customer number should count my customers and not all my users. And the Order ID is not the right for this either, cause if customer 1 is making 2 order and then customer 3 is ordering he would get 3 as ID.
I´m not that good with PHP so I´m not sure how to do this?
Do I miss an existing index I could use? Or do I have to create my own from scratch?
But how to do this?
Any help appreciated, thank you.
Cheers Can
*EDIT: Maybe I can write the first one manually and for the next one I just sum 1 to the last one?!
But then I need to access the cutomer number from the last created customer in rules and i have no idea how to do this.
*EDIT2: Just tried to use the profile2 module. Made a profile type "customer profile" with the customer number field, but creating the number only worked once, and only for me as admin.
Tried to set a default value for this field cause I read about date field issues that it can´t be empty when set values with rules, but even this is not workin.
I´m not even sure if the profile2 thing is a solution, I thought maybe it counts different, cause only customers will get an profile but maybe I´m wrong.
Comments
Comment #0.0
CanOne commentedJust another thought.
Comment #1
rszrama commentedClosing this for lack of response in a year. Sorry you weren't able to get any advice here.
Comment #1.0
rszrama commentedJust another idea about using profile2 module