1. jsanglier
  2. General
  3. Sunday, November 07 2021, 01:55 PM
Hi,
I'm using Convert Form plugin for my registration form.
https://www.tassos.gr/joomla-extensions/convert-forms/docs/how-to-create-a-custom-joomla-user-registration-form

I have email, fistname, lastname and password as fields.
But, when a user is created with the code, it didn't add the fistname.
Can you help me for the PHP code to add to update the fistname field ?
admin Accepted Answer
Admin
Hi,
you can use JsnUser object http://docs.easy-profile.com/index.php/article/jsnuser-object
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$user=JsnHelper::getUser($user_id);
$user->firstname = $user_firstname;
$user->save();
NOTE: you should fill variables $user_id and $user_firstname with correct values
  1. more than a month ago
  2. General
  3. # 1
jsanglier Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
unfortunately I does not know how to works Convert Form, so we are not aware how to get variables like user ID and firstname.

Also there is an error in line 6, this
$jsnuser=JsnHelper::getUser($new_user>id);
should come
$jsnuser=JsnHelper::getUser($new_user->id);
But probably variable $lastname is not filled with the form value.
  1. more than a month ago
  2. General
  3. # 3
jsanglier Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
Hi,
normally the table #__jsn_users is filled when user update or create an account, the sync button create a empty row for each pre-existing user in the Easy Profile user table to avoid problems with third party components. Basically if you does not have errors then this button is useless.
  1. more than a month ago
  2. General
  3. # 5
jsanglier Accepted Answer
Hi,
I have an issue to update a radio button with this code. $user_type contain either prospect-B2B, prospect-B2C
$jsnuser->contact_type = $user_type;

contact_type is a field with
Public|Non défini
prospect-B2C|Prospect B2C
prospect-B2B|Prospect B2B
client-B2C|Client B2C
client-B2B|Client B2B
client-B2B-premium|Client B2B Premium

>> What is the right code the select the value ?
  1. more than a month ago
  2. General
  3. # 6
jsanglier Accepted Answer
It' finally working #typo
  1. more than a month ago
  2. General
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.