Morning,
Thanks for that however I do not have that complete piece of code. Below is an extract of the code,
else if($mode == 2) {
$userData->user_email = $registerData->email;
$query = 'SELECT * FROM '.hikashop_table('user').
' WHERE user_email = '.$this->database->Quote($userData->user_email);
$this->database->setQuery($query);
$userInDB = $this->database->loadObject();
if(@$userInDB->user_cms_id) {
$ret['status'] = false;
$ret['messages'][] = array(JText::_('EMAIL_ADDRESS_ALREADY_USED'), 'warning');
return $ret;
}
$ret['user_id'] = (isset($userInDB->user_id) ? (int)$userInDB->user_id : 0);
if(!empty($ret['user_id'])) {
$userInDB->user_created_ip = hikashop_getIP();
$this->save($userInDB);
} else {
$ret['user_id'] = $this->save($userData);
}
$query = 'UPDATE '.hikashop_table('address').' AS hk_addr '.
' SET hk_addr.address_published = 0 '.
' WHERE hk_addr.address_user_id='.(int)$ret['user_id'].' AND hk_addr.address_published = 1';
$this->database->setQuery($query);
$this->database->query();
I have removed the following which stops the error coming up however will not let the user continue.
if(@$userInDB->user_cms_id) {
$ret['status'] = false;
$ret['messages'][] = array(JText::_('EMAIL_ADDRESS_ALREADY_USED'), 'warning');
return $ret;
}
Cheers
Iain