How to add Telephone number on Registration

  • Posts: 105
  • Thank you received: 1
  • Hikashop Business
4 months 1 week ago #343464

-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0.21
-- Browser(s) name and version -- : chrome

How do I add a telephone number on the registration form so it will be synchronized with Joomla 4 User profile?

I have used your recommendations such as: "Turn back on the "ask address on registration" option of the configuration.
Then, go in the menu Display>Custom fields and disable all the address fields except the telephone one and you'll have what you want. "

but i need telephone number displayed in Joomla user.
2) Is there any snippet code i can use from Hikashop to display Telephone number and also user Name and Username on a front end? _ because that is my goal.

Alex

Last edit: 4 months 1 week ago by alexmartin.

Please Log in or Create an account to join the conversation.

  • Posts: 77249
  • Thank you received: 12165
  • MODERATOR
4 months 1 week ago #343466

Hi,

In the HikaShop user synchronization plugin settings, there is a setting you can activate to display the custom fields of the table "user" on the Joomla user profile edit page of the frontend.
So that means you can't use the addres_telephone field for that as that's an address field, not a user field.
But you can disable that field, and instead create a new custom user field for that.

Last edit: 4 months 1 week ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 105
  • Thank you received: 1
  • Hikashop Business
4 months 1 week ago #343521

Yes, i made custom User filed, and it is displayed on the Hikashop User page. Not a problem. But it does not display on the Joomla User profile.
1) Is it possible to to display the number on the Joomla user profile?
2) Is there any snippet code I can use to display that field on the front end on Joomla pages?
Looking forward
Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 77249
  • Thank you received: 12165
  • MODERATOR
4 months 1 week ago #343523

Hi,

As I said, it will display on the user profile edit page if you activate the corresponding setting of the HikaShop user synchronization plugin.
So no code required.

Now, you can display the value of a custom user field quite easily anywhere on your website with such code:

// load hikashop
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;
$user = hikashop_loadUser(true);
echo $user->xxx;
Where xxx is the column name of the custom field.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum