VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: aravot on September 13, 2007, 22:57:36 PM

Title: Customer Number / ID missing when user is created in VM backend
Post by: aravot on September 13, 2007, 22:57:36 PM
Joomla 1.0.12
VM 1.1 r942

Customer Number / ID missing when user is created in VM backend.
Title: Re: Customer Number / ID missing when user is created in VM backend
Post by: Soeren on September 14, 2007, 11:54:08 AM
Does someone have a suggestion how to solve this problem?
This would be a new feature, as new customers never automatically received a Customer ID during registration.

ciao, Sören
Title: Re: Customer Number / ID missing when user is created in VM backend
Post by: aravot on September 15, 2007, 08:24:57 AM
We should include customer number / ID in the invoice too.
Title: Re: Customer Number / ID missing when user is created in VM backend
Post by: aravot on September 15, 2007, 18:35:53 PM
Quote from: gregdev on September 15, 2007, 14:26:10 PM
Since the customer number is not really used in VirtueMart right now, perhaps we should discuss what it is and what its purpose is.


What is a customer number used for?
My guess to ensure uniqueness / verification of customer.

What should a customer number look like? length? characters?
I checked my Dell, Newegg, Staples and Office Depot accounts customer numbers are numeric and were 8 characters long.

How might it be used to integrate VM with other systems?
Don't know, my guess verification, ensure there is no mix up if members have the same name or lastname or both.

When would a customer number be visible
Yes

Can a customer number be changed? If so, by whom? the shop owner?
Only by shop owner.

Should it just be a blank field that is populated by external programs for integration?
Don't know

Below is an example of Dell's; ordered an AC adapter few days ago (removed some info for security)

(http://www.filefarmer.com/aravot/pix/dellorder.gif)
Title: Re: Customer Number / ID missing when user is created in VM backend
Post by: willowtree on May 20, 2008, 08:35:09 AM
customer number is used (vm 1.0.13) in shopper_vendor_xref to assign shopper groups
Title: Re: Customer Number / ID missing when user is created in VM backend
Post by: webdesco on March 02, 2011, 15:53:47 PM
Hi,
for all this is an old topic I'm currently running 1.1.6 and this issue still exists.
To at least provide a unique customer in the backend so as it reflects the front end I've modified line 398 of ps_shopper_group.php
from
return $db->f("customer_number");
to

return ($db->f("customer_number") == "") ? uniqid( rand() ) : $db->f("customer_number");

The above seems to work Okay when adding a new user however there is a glitch when modifying an existing user that has a blank customer_number (i.e one that was added before I added this mod).  The script recognises that the customer number is blank and generates a new one, this new code is shown in the edit form, however it is not saved when you click save, as when you edit the same user a different (new random) customer number is shown.
Not too much of an issue as I'll be deleting the test users that have a blank customer_number anyway. Any thought?