HikaShop User ID sometimes does not match Joomla User ID

  • Posts: 24
  • Thank you received: 1
6 years 8 months ago #275523

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.0

Hi,

We are having an issue with a custom registration plugin that is using the HikaShop custom fields and some of the user IDs are returning information from other customers because the some IDs do not match between HikaShop and Joomla. Is there an easy way to synchronize the user IDs in the database, so that our custom registration plugin works correctly? Any help you can offer is appreciated.

Kind Regards,
Miles

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 8 months ago #275531

Hi,

It's normal that the user_id of the hikashop_user table doesn't match necessarily the user_cms_id of the same table (which correspond to the id of the users table of Joomla).
A user in the hikashop_user will be created for guest users but they won't have an entry in the users table since they won't have a Joomla user account, and thus the user_cms_id will be 0 for that entry.
And if the next user creates a user account, his user_cms_id will then be 1 less than the user_id.
If you don't allow for guest checkout, and if you have the users and the hikashop_user tables synchronized (with MySQL queries to update the ids) it should lead to the user_id being always equal to the user_cms_id.
But I think that the best would be to fix the custom plugin you have so that it can use the correct ids.

The following user(s) said Thank You: pcomelearning

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

  • Posts: 24
  • Thank you received: 1
6 years 8 months ago #275589

Got it working. Just using the HikaShop user_cms_id instead of the user_id fixed the issue. Thank you for the detailed response.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum