ok, I did a little digging, and found out this:
in the file: /components/com_hikashop/controllers/address.php
on line 72 it's saves the address using this code:
$address_id = $addressClass->save($addressData);
so, I added my code:
if (!$address_id) {
echo 'phone already assigned to user, please select a different one';
}
so now I can see (for a sec) this error massage when trying to insert a duplicate phone number in address, and then it returns to the form.
the thing is, I want to check that this is the error (
if (mysql_errno() == 1062) {
print 'phone already assigned to user, please select a different one';
}
and then return this text to the form.
any idea on how to do it?