Skip to main content

Import users from an external database

More
10 years 2 months ago #246414 by PeterChain
-- 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.

More
10 years 2 months ago #246432 by nicolas
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.

More
10 years 2 months ago #246448 by PeterChain

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.

More
10 years 2 months ago #246461 by nicolas
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.176 seconds
Powered by Kunena Forum