Author Topic: Customer Number / ID missing when user is created in VM backend  (Read 9602 times)

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Customer Number / ID missing when user is created in VM backend
« 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.

Soeren

  • Administrator
  • Sr. Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: Customer Number / ID missing when user is created in VM backend
« Reply #1 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
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

gregdev

  • Full Member
  • ***
  • Posts: 968
    • PlainlyCode
Re: Customer Number / ID missing when user is created in VM backend
« Reply #2 on: September 14, 2007, 19:35:43 pm »
If the shopper is created through the frontend registration process (i.e. ps_shopper::add()), they are assigned a customer number like this:

Code: [Select]
$customer_nr = uniqid( rand() );
But, it is not used or assigned anywhere else in the code.

Greg


gregdev

  • Full Member
  • ***
  • Posts: 968
    • PlainlyCode
Re: Customer Number / ID missing when user is created in VM backend
« Reply #4 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?
  • What should a customer number look like? length? characters?
  • How might it be used to integrate VM with other systems?
  • When would a customer number be visible
  • Can a customer number be changed? If so, by whom? the shop owner?
  • Should it just be a blank field that is populated by external programs for integration?
  • etc

Greg

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Customer Number / ID missing when user is created in VM backend
« Reply #5 on: September 15, 2007, 18:35:53 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)


willowtree

  • Full Member
  • ***
  • Posts: 542
    • Willow Tree Crafts
Re: Customer Number / ID missing when user is created in VM backend
« Reply #6 on: May 20, 2008, 08:35:09 am »
customer number is used (vm 1.0.13) in shopper_vendor_xref to assign shopper groups
Please add your VM and Joomla Version to your signature to make it easier to help you:

Most of my code posted in the forum is for VirtueMart 1.0  -  not for 1.1

webdesco

  • Beginner
  • *
  • Posts: 8
Re: Customer Number / ID missing when user is created in VM backend
« Reply #7 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
Code: [Select]
return $db->f("customer_number");to

Code: [Select]
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?