VM3.0.18 on J3.6.2 and PHP5.6.24
I don't want registered users to change their username once they have registered. This is for tracking reasons.
The solution is probably to set Shopper Field username 'Read-Only' radio button to 'yes' in VM configuration. But then, new registrations through VM cannot fill in a username because the empty form field is made 'read only' and cannot be changed.
The same probably applies to all other fields as well. I haven't checked this.
this?
Quote from: GJC Web Design on October 01, 2016, 18:47:44 PM
this?
No, this affects the Joomla-based function ("User profile") only and not the VM account maintenance ("Shopper Information") routines.
My solution/work-around is to exempt the readonly attribute when the field is empty.
As presented below (base is VM3.0.18).
File
/administrator/components/com_virtuemart/models/userfields.phpLines 802 to 807 reads:
$readonly = '';
if(!$admin){
if($_fld->readonly ){
$readonly = ' readonly="readonly" ';
}
}
Change the second if condition into:
$readonly = '';
if(!$admin){
if( $_fld->readonly && !empty($_userData[$_fld->name]) ){
$readonly = ' readonly="readonly" ';
}
}
Fixed!! But... a core hack, something I don't really want to do.
Nice idea, but why do you not use the correct fix. The correct fix is to implement the joomla setting to our usermodel, so that users cannot change their name.