Add custom fields to registration form in Joomla

Finally after long time of search for a solution in how to add custom fields to registration form in Joomla i think there where no solution except change in main core of  joomla but i created a solution by myself i hope it can help you:

1- Download the Chronoforms_V4_RC3.5.2.5_J3.0 Joomla componant from here

2- create a Custome Form you want to be your registration form and click on Forms manger to show the link for front end view

3- Now you need to add the custome field to Database as columns to add the data in form this can do by open database then the users tabel(#__users) and add the fields you need and its type

4- now all you need to add data to 2 tables in database (#__users) and (#__user_usergroup_map ) and you can do this by add some lines of code to 2 functions in the plugin as following:

4.1- open the file : <You project Work space >/components/com_chronoforms/libraries/chronoform.php

4.2-(Note: if you want to add Password Field only use this point) Search for function _set_form_data() add the following lines of code if you want to add password as it is encrypted by MD5 + salt:

/* * Start */

$salt = JUserHelper::genRandomPassword(32); $crypt = JUserHelper::getCryptedPassword($this->data[“password”], $salt); $password = $crypt . ‘:’ . $salt; $this->data[“password”] = $password; /* * End */ 4.3- Search for function process($event = null) and add the following code after the line “$return = $this->_processEvents($event, $events[‘events’]);” /* * Start */ $db =& JFactory::getDBO(); $query = “INSERT INTO `#__user_usergroup_map` (user_id,group_id) VALUES (‘”.$this->data[“chronoform_data”][“id”].”‘, 2)”; $db->setQuery( $query ); $db->query();

/* * End */