Import users from an external database

  • Posts: 634
  • Thank you received: 16
8 years 3 months ago #246414

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.0
-- PHP version -- : 5.6.10
-- Browser(s) name and version -- : Google Chrome 51.0.2704.103 (64-bit)

I have to import customers from an external database into the #__hikashop_user (with custom fields) and the joomla #__users table from my own made component.

Is there an available method for this

or

Can I simply use a query agains #__hikashop_user table.

-- Víctor

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 3 months ago #246432

Hi,

How are you going to generate the password in the Joomla user table with the format corresponding to Joomla ?
That's the big question here.
The HikaShop part is the easy part. You'll just need an update query to add the hikashop_user rows with the user id coming from the joomla user table and the custom fields data coming from your component data.

The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
8 years 3 months ago #246448

nicolas wrote: Hi,

How are you going to generate the password in the Joomla user table with the format corresponding to Joomla ?
That's the big question here.
The HikaShop part is the easy part. You'll just need an update query to add the hikashop_user rows with the user id coming from the joomla user table and the custom fields data coming from your component data.


Well, my option was to use the function register() on the UsersModelRegistration and use the id returning from the function to make an insert to the #__hikashop_users table, but i didn't know if i can do it from this way or there's a function in Hikashop that allows you to do it.

-- Víctor

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 3 months ago #246461

Hi,

Well, there is the save function of the class.user of HikaShop, to do it, but in your case, doing a simple insert in MySQL will do the same and will be simpler to implement so I would go with the insert.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum