News:

Support the VirtueMart project and become a member

Main Menu

Registration issue

Started by doorknob, September 23, 2008, 15:05:13 PM

Previous topic - Next topic

doorknob

I have configured my system to use only the 'First Name' when registering. I don't need the full name because my site is 'catalogue only' with no shopping cart (BTW in the UK it is an offence against the Data Registration act to collect and store personal information that is not needed for business purposes).

Now when a user registers, the 'Last Name' field is omitted from the form (as expected) but when creating the 'name' field in the jos_name table, the value then defaults to 'Last Name'. In addition, there are a few functions where the full name is created on the fly and a null last name becomes a trailing space because of the way the first and last names are put together with an embedded space.

I have fixed this in my system with the following changes to classes/ps_shopper:

line 279:
$_POST['name'] = vmGet($d,'first_name','First Name' )." ".vmGet($d,'last_name','Last Name' );

changed to:
$_POST['name'] = trim( vmGet( $d, 'first_name', '' )." ".vmGet( $d, 'last_name', '' ) );


line 433/4:
$db->query( "INSERT INTO `#__ccnewsletter_subscribers` ( `name`, `email`, `plainText`, `enabled`, `sdate`)
VALUES('".$d['first_name']." ". $d['last_name']."','".$d['email']."', '0', '1', NOW())" );

changed to:
$name = trim( $d['first_name']." ". $d['last_name'] );
$db->query( "INSERT INTO `#__ccnewsletter_subscribers` ( `name`, `email`, `plainText`, `enabled`, `sdate`)
VALUES('$name','".$d['email']."', '0', '1', NOW())" );


line 439/40:
$db->query( "INSERT INTO `#__letterman_subscribers` (`user_id`, `subscriber_name`, `subscriber_email`, `confirmed`, `subscribe_date`)
VALUES('$uid','".$d['first_name']." ". $d['last_name']."','".$d['email']."', '1', NOW())");

changed to:
$name = trim( $d['first_name']." ". $d['last_name'] );
$db->query( "INSERT INTO `#__letterman_subscribers` (`user_id`, `subscriber_name`, `subscriber_email`, `confirmed`, `subscribe_date`)
VALUES('$uid','$name','".$d['email']."', '1', NOW())");


line 656:
$_POST['name'] = $d['first_name']." ". $d['last_name'];

replaced by:
$_POST['name'] = trim( $d['first_name']." ". $d['last_name'] );


regards
Phil

lucato

It didn't work for VM 1.1.3. I'm getting the register e-mails, the name on the log-in with the 1st name+"last name" and I've disable the "last name" user field from the managment fields.

Does anybody have any idea how to get rid of it on 1.1.3?

Thanks.

wowderland

Im having the same issue. Anybody have a suggestion on this ?

doorknob

This patch is still working for me (v1.1.4)

wowderland

Hello. I've done it again today and it worked perfectly. Thanks a lot !!!

Destini

This worked for me as well ...

Ideally I'd like it to not ask for any name at all, first or last and only username/email/password ... but I'm not sure what to change in that hack above. If anyone knows this, I'd love to know.

Either way though a very viable solution to what has been an all day problem. Thanks for sharing, Doorknob!