[Skip to main content](#vessel-content)

#   Wrong Address atributed to Hikashop Users

##

- **[Manuel TT](/forum/user/29324-manuel-tt "View Manuel TT's Profile")**
- [![Manuel TT's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29324.jpg)](/forum/user/29324-manuel-tt "View Manuel TT's Profile") Topic Author
- [ Offline](/forum/user/29324-manuel-tt)

Less More

- Posts: 36
- Thank you received: 5
-
-

8 years 4 months ago [\#294669](#294669) by [Manuel TT](/forum/user/29324-manuel-tt "View Manuel TT's Profile")  *[Wrong Address atributed to Hikashop Users](/forum/3-bug-report/895124-wrong-address-atributed-to-hikashop-users#294669 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.5 -- PHP version -- : 7.0.30 -- Browser(s) name and version -- : All Browsers - does not matter  Hello,  I have found a small bug (at least im my ‘system’) that I would loke to report. I’m reporting in chronological order of the steps that lead to the bug so the real bug is only described in the end!  My Hikashop (currently HikaShop Business 3.2.0 &#91;1709121646&#93;), was migrated from Virtuemart in 2015 (I think with some import tool from Hikashop – can’t remember for sure). I think because of this for some old (from Virtuemart) entries in table hikashop&#95;address the id in address&#95;user&#95;id field is the user&#95;cms&#95;id and not the user&#95;id (I’m referring to the naming convention of table hikashop&#95;user).  This was not a big problem because:  Addresses with address&#95;published=1 (published) - the ones showing up for selection in front office and backoffice) all had the correct id (user&#95;id from hikashop) and not user&#95;cms&#95;id) in address&#95;user&#95;id, even the ones from that had originated from virtuemart.. I.e. from virtumeart time only some of the not published ones (address&#95;published=0) had the wrong user information. So I could relate addresses to the correct user according to:  &#42; If address&#95;published=1 relate to the correct user by interpreting hikashop&#95;address.address&#95;user&#95;id as hikashop&#95;user.user&#95;id  &#42; If address&#95;published=0 relate to the correct user by using the information in hikashop&#95;order table , assuming hikashop&#95;order.order&#95;user&#95;id is hikashop&#95;user.user&#95;id (I have not really tested this in deep but for some orders/users with the virtuemart wrong id problem I tested and it was ok to use the order table to relate to the correct user!)  I think this is the way Hikashop does because in backoffice I was never presented with wrong information for customers addresses or orders. It took me quite some time to understand this, and my interpretation is that for Hikashop from a functional point of view (backoffice / front office) there are two kinds of address entries.  &#42; The ones that have to do with address from the user (published)  &#42; the ones that have to do with addresses from the orders (not published)  I interpreted like this because when creating a new address while placing an order two entries are in fact created in the hikashop&#95;address table:  &#42; one (published) that belongs to the user  &#42; one (not published) that relates to the order (this is only created when the order is finalized )  However!!! I then tried to go to an old order from virtuemart times (one with the problem of the wrong user&#95;id in the hikashop&#95;address table, and edit the address for the order in the backoffice (for testing purposes I just edited the post code) . What happened was that a published address (address&#95;published=1) was created for the wrong user because the new entry created is kind of a ‘duplicate’ of the old one (with the user&#95;cms&#95;id value in the address&#95;user&#95;id field) and with the edit made (in the backoffice) to post code. So in the backoffice (and probably in frontoffice) this new address entrey shows up as selectable for the wrong user and also associated with the edited order (for the correct user).  Why have I taken all this steps? I’m trying to clean the site of bad/spam accounts (almost 10K hikashop users and lots of them are fake/spam – before I configured recaptcha), and so I was trying to cross information that could help better identify those fake users – ad the way their boots fill in the address information is revealing). I was going crazy trying to understand why some clearly fake users had legit addresses until I understood I was a mix up because of the records converted from virtuemart and the address&#95;user&#95;id field some times having the wrong info (user&#95;cms&#95;id and not user&#95;id ).  If I could correct the wrong hikashop&#95;address.address&#95;user&#95;id information (from virtuemart times) none of this would be a problem and I would have a cleaner database! I suspect all the entries with the wrong hikashop&#95;address.address&#95;user&#95;id information have the hikashop&#95;address.address&#95;vm&#95;order&#95;info&#95;id filled in (not null) and the other way around, but I’m not sure (this field was surely created by the virtuemart to hikashop import tool). If you could confirm that this is so then I could make a query (very carefully) that for those entries with hikashop&#95;address.address&#95;vm&#95;order&#95;info&#95;id not null would replace the hikashop&#95;address.address&#95;user&#95;id value with the correct one by looking up the correct value in hikashop&#95;user.user&#95;id (i.e look up hikashop&#95;address.address&#95;user&#95;id = hikashop&#95;user.user&#95;cms&#95;id and return hikashop&#95;user.user&#95;id to replace the value back in hikashop&#95;address.address&#95;user&#95;id). Could someone from Hikashop help me be sure of this?  Best regards")* was created by *[Manuel TT](/forum/user/29324-manuel-tt "View Manuel TT's Profile")*

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.7.5
-- PHP version -- : 7.0.30
-- Browser(s) name and version -- : All Browsers - does not matter

Hello,

I have found a small bug (at least im my ‘system’) that I would loke to report.
I’m reporting in chronological order of the steps that lead to the bug so the real bug is only described in the end!

My Hikashop (currently HikaShop Business 3.2.0 [1709121646]), was migrated from Virtuemart in 2015 (I think with some import tool from Hikashop – can’t remember for sure).
I think because of this for some old (from Virtuemart) entries in table **hikashop\_address** the **id in address\_user\_id** field is the **user\_cms\_id** and not the **user\_id** (I’m referring to the naming convention of table **hikashop\_user**).

This was not a big problem because:

Addresses with **address\_published**=1 (published) - the ones showing up for selection in front office and backoffice) all had the correct id (**user\_id** from hikashop) and not **user\_cms\_id**) in **address\_user\_id**, even the ones from that had originated from virtuemart.. I.e. from virtumeart time only some of the not published ones (**address\_published**=0) had the wrong user information.
So I could relate addresses to the correct user according to:

- If **address\_published**=1 relate to the correct user by interpreting **hikashop\_address.address\_user\_id** as **hikashop\_user.user\_id**
- If **address\_published**=0 relate to the correct user by using the information in hikashop\_order table , assuming **hikashop\_order.order\_user\_id** is **hikashop\_user.user\_id** (I have not really tested this in deep but for some orders/users with the virtuemart wrong id problem I tested and it was ok to use the order table to relate to the correct user!)

I think this is the way Hikashop does because in backoffice I was never presented with wrong information for customers addresses or orders.
It took me quite some time to understand this, and my interpretation is that for Hikashop from a functional point of view (backoffice / front office) there are two kinds of address entries.

- The ones that have to do with address from the user (published)
- the ones that have to do with addresses from the orders (not published)

I interpreted like this because when creating a new address while placing an order two entries are in fact created in the hikashop_address table:

- one (published) that belongs to the user
- one (not published) that relates to the order (this is only created when the order is finalized )

However!!! I then tried to go to an old order from virtuemart times (one with the problem of the wrong **user\_id** in the hikashop_address table, and edit the address for the order in the backoffice (for testing purposes I just edited the post code)
. What happened was that a published address (**address\_published**=1) was created for the wrong user because the new entry created is kind of a ‘duplicate’ of the old one (with the **user\_cms\_id** value in the address_**user\_id** field) and with the edit made (in the backoffice) to post code. So in the backoffice (and probably in frontoffice) this new address entrey shows up as selectable for the wrong user and also associated with the edited order (for the correct user).

Why have I taken all this steps? I’m trying to clean the site of bad/spam accounts (almost 10K hikashop users and lots of them are fake/spam – before I configured recaptcha), and so I was trying to cross information that could help better identify those fake users – ad the way their boots fill in the address information is revealing). I was going crazy trying to understand why some clearly fake users had legit addresses until I understood I was a mix up because of the records converted from virtuemart and the address_user_id field some times having the wrong info (**user\_cms\_id** and not **user\_id** ).

If I could correct the wrong **hikashop\_address.address\_user\_id** information (from virtuemart times) none of this would be a problem and I would have a cleaner database!
I suspect all the entries with the wrong **hikashop\_address.address\_user\_id** information have the **hikashop\_address.address\_vm\_order\_info\_id** filled in (not null) and the other way around, but I’m not sure (this field was surely created by the virtuemart to hikashop import tool). If you could confirm that this is so then I could make a query (very carefully) that for those entries with **hikashop\_address.address\_vm\_order\_info\_id** not null would replace the **hikashop\_address.address\_user\_id** value with the correct one by looking up the correct value in **hikashop\_user.user\_id** (i.e look up **hikashop\_address.address\_user\_id** = **hikashop\_user.user\_cms\_id** and **return hikashop\_user.user\_id** to replace the value back in **hikashop\_address.address\_user\_id**).
Could someone from Hikashop help me be sure of this?

Best regards

---

VC22

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84OTUxMjQtd3JvbmctYWRkcmVzcy1hdHJpYnV0ZWQtdG8taGlrYXNob3AtdXNlcnM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

8 years 4 months ago [\#294672](#294672) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Wrong Address atributed to Hikashop Users](/forum/3-bug-report/895124-wrong-address-atributed-to-hikashop-users#294672 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.7.5 -- PHP version -- : 7.0.30 -- Browser(s) name and version -- : All Browsers - does not matter  Hello,  I have found a small bug (at least im my ‘system’) that I would loke to report. I’m reporting in chronological order of the steps that lead to the bug so the real bug is only described in the end!  My Hikashop (currently HikaShop Business 3.2.0 &#91;1709121646&#93;), was migrated from Virtuemart in 2015 (I think with some import tool from Hikashop – can’t remember for sure). I think because of this for some old (from Virtuemart) entries in table hikashop&#95;address the id in address&#95;user&#95;id field is the user&#95;cms&#95;id and not the user&#95;id (I’m referring to the naming convention of table hikashop&#95;user).  This was not a big problem because:  Addresses with address&#95;published=1 (published) - the ones showing up for selection in front office and backoffice) all had the correct id (user&#95;id from hikashop) and not user&#95;cms&#95;id) in address&#95;user&#95;id, even the ones from that had originated from virtuemart.. I.e. from virtumeart time only some of the not published ones (address&#95;published=0) had the wrong user information. So I could relate addresses to the correct user according to:  &#42; If address&#95;published=1 relate to the correct user by interpreting hikashop&#95;address.address&#95;user&#95;id as hikashop&#95;user.user&#95;id  &#42; If address&#95;published=0 relate to the correct user by using the information in hikashop&#95;order table , assuming hikashop&#95;order.order&#95;user&#95;id is hikashop&#95;user.user&#95;id (I have not really tested this in deep but for some orders/users with the virtuemart wrong id problem I tested and it was ok to use the order table to relate to the correct user!)  I think this is the way Hikashop does because in backoffice I was never presented with wrong information for customers addresses or orders. It took me quite some time to understand this, and my interpretation is that for Hikashop from a functional point of view (backoffice / front office) there are two kinds of address entries.  &#42; The ones that have to do with address from the user (published)  &#42; the ones that have to do with addresses from the orders (not published)  I interpreted like this because when creating a new address while placing an order two entries are in fact created in the hikashop&#95;address table:  &#42; one (published) that belongs to the user  &#42; one (not published) that relates to the order (this is only created when the order is finalized )  However!!! I then tried to go to an old order from virtuemart times (one with the problem of the wrong user&#95;id in the hikashop&#95;address table, and edit the address for the order in the backoffice (for testing purposes I just edited the post code) . What happened was that a published address (address&#95;published=1) was created for the wrong user because the new entry created is kind of a ‘duplicate’ of the old one (with the user&#95;cms&#95;id value in the address&#95;user&#95;id field) and with the edit made (in the backoffice) to post code. So in the backoffice (and probably in frontoffice) this new address entrey shows up as selectable for the wrong user and also associated with the edited order (for the correct user).  Why have I taken all this steps? I’m trying to clean the site of bad/spam accounts (almost 10K hikashop users and lots of them are fake/spam – before I configured recaptcha), and so I was trying to cross information that could help better identify those fake users – ad the way their boots fill in the address information is revealing). I was going crazy trying to understand why some clearly fake users had legit addresses until I understood I was a mix up because of the records converted from virtuemart and the address&#95;user&#95;id field some times having the wrong info (user&#95;cms&#95;id and not user&#95;id ).  If I could correct the wrong hikashop&#95;address.address&#95;user&#95;id information (from virtuemart times) none of this would be a problem and I would have a cleaner database! I suspect all the entries with the wrong hikashop&#95;address.address&#95;user&#95;id information have the hikashop&#95;address.address&#95;vm&#95;order&#95;info&#95;id filled in (not null) and the other way around, but I’m not sure (this field was surely created by the virtuemart to hikashop import tool). If you could confirm that this is so then I could make a query (very carefully) that for those entries with hikashop&#95;address.address&#95;vm&#95;order&#95;info&#95;id not null would replace the hikashop&#95;address.address&#95;user&#95;id value with the correct one by looking up the correct value in hikashop&#95;user.user&#95;id (i.e look up hikashop&#95;address.address&#95;user&#95;id = hikashop&#95;user.user&#95;cms&#95;id and return hikashop&#95;user.user&#95;id to replace the value back in hikashop&#95;address.address&#95;user&#95;id). Could someone from Hikashop help me be sure of this?  Best regards")*

Hi,

Yes, it sometimes happen that there are addresses with issues when imported from VirtueMart.
Updating the address_user_id based on the order_user_id should be quite easy to do by simply running a MySQL query in your PHPMyAdmin. Something like that: Code:

UPDATE #__hikashop_address as a, #__hikashop_order as o SET a.address_user_id = o.order_user_id WHERE (a.address_id = o.order_shipping_address_id OR a.address_id = o.order_billing_address_id) AND a.address_published = 0

I was able to reproduce the problem thanks to your details, and thus we'll have a patch of the VM import for the next version to avoid that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84OTUxMjQtd3JvbmctYWRkcmVzcy1hdHJpYnV0ZWQtdG8taGlrYXNob3AtdXNlcnM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.075 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
