I try to understand how the table '_hikashop_user' works

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
1 year 10 months ago #348513

Hi,

While searching the database, I found some recent entries that are a bit different and I wanted to know if this is normal and understand it.

I think it's since version 4.6.2 of Hikashop and we don't have version 4.7.0 installed yet.

In the '_hikashop_user' table, I have few new users with the field 'user_cms_id 'setted to 0
In the '_hikashop_address', I have few addresses with the field 'address_user_id' setted to 0 and rows fully empty in this case.

I also noted the appearance of a new field 'user_created' always filled since few rows.
Since this field looks like a timestamp, is there now some kind of automatic cleanup?

These changes may be indicated somewhere, but it is mainly that I find it difficult to understand what is happening.

Before, I understood that if a user was ordering as a guest, the 'user_cm_id' or 'user_id' of the '_hikashop_user' table was not added in the '_users' table.

Can you explain to me how this works?

Thanks in advance.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 10 months ago #348515

Hi,

When a user goes through the checkout and registers, first a Joomla user account is created in the users table. After that, HikaShop creates a corresponding entry in hikashop_user and uses the "id" from the users table to fill the user_cms_id column in hikashop_user.
If the user goes through the checkout as a guest, then nothing is created in the users table. Only an entry in the hikashop_user table is created, and thus the user_cms_id is set to 0.
The user_created column has always been in the hikashop_user table and always filled with the timestamp of when the user is added to the table.
There is no auto cleanup of hikashop_user entries. Either they are linked to the users table and you don't want to delete the user account of users automatically (at least not normally), or they are linked to an order in the hikashop_order table, and you don't want to delete that link either or you'll have an order without an email address.

When an address is created in the hikashop_address table, the user_id from the hikashop_user table for the current user is set in the address_user_id column.
I'm not sure how you get entries with the address_user_id column empty and all the other columns empty. It should not be happening. I suppose it's a glitch but well, since the address is not linked to anything, it just won't appear anywhere and you can just ignore them.

The following user(s) said Thank You: FDBI

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

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
1 year 10 months ago #348520

Thanks for your answer.

Firstly, sorry for the wrong information on the 'user_created' column, it does indeed always existed and I don't know why I mentioned it.
For my table 'hikashop_address', I would watch if it happens again, but I haven't noticed any malfunction in the orders.

Everything seems clear, thank you !

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

Time to create page: 0.050 seconds
Powered by Kunena Forum