function onAfterInitialise() {
$display = $this->params->get('fields_on_user_profile');
if(is_null($display))
$display = 1;
if(empty($display) || $display=='0')
return;
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$task = JRequest::getCmd('task');
$layout = JRequest::getCmd('layout');
if(($option != 'com_user' || $view != 'user' || $task != 'edit') && ($option != 'com_users' && $view != 'profile' && $layout != 'edit'))
return;
if(!defined('DS'))
define('DS', DIRECTORY_SEPARATOR);
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return true;
$user = hikashop_loadUser(true);
$fieldsClass = hikashop_get('class.field');
$extraFields = array(
'user' => $fieldsClass->getFields('frontcomp',$user,'user')
);
if(empty($extraFields['user']))
return;
$null = array();
$fieldsClass->addJS($null,$null,$null);
$fieldsClass->jsToggle($extraFields['user'],$user,0);
foreach($extraFields['user'] as $fieldName => $oneExtraField) {
$fieldsClass->display($oneExtraField, @$user->$fieldName, 'data[user]['.$fieldName.']', false, '',false, $extraFields['user'], $user);
}
}
Thanks to that, it will include the special javascript libraries in the page and the complex custom fields will be able to be displayed.