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

#   changing customeraddress in backend database error

##

- **[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")**
- [![jouwnaambord.nl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile") Topic Author
- [ Offline](/forum/user/1188-jouwnaambord-nl)

Less More

- Posts: 515
- Thank you received: 22
-
-

10 years 3 months ago [\#246452](#246452) by [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")  *[changing customeraddress in backend database error](/forum/35-orders-management/885769-changing-customeraddress-in-backend-database-error#246452 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.5.9  Hi,  When I change an address (billing or shipping) in an existing or new order, the address&#95;user&#95;id in the database stays empty (0) instead of being updated with the user&#95;id. Could this be a bug?  Michel")* was created by *[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6
-- PHP version -- : 5.5.9

Hi,

When I change an address (billing or shipping) in an existing or new order, the address_user_id in the database stays empty (0) instead of being updated with the user_id. Could this be a bug?

Michel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTc2OS1jaGFuZ2luZy1jdXN0b21lcmFkZHJlc3MtaW4tYmFja2VuZC1kYXRhYmFzZS1lcnJvcj90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

10 years 3 months ago [\#246463](#246463) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[changing customeraddress in backend database error](/forum/35-orders-management/885769-changing-customeraddress-in-backend-database-error#246463 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.5.9  Hi,  When I change an address (billing or shipping) in an existing or new order, the address&#95;user&#95;id in the database stays empty (0) instead of being updated with the user&#95;id. Could this be a bug?  Michel")*

Hi,

The address_user_id of an address should never be 0 unless you deleted the user entry in the hikashop_user table.
So I don't understand why you say that it "stays" empty. It should not be 0 to begin with when it is created in the frontend.

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

- **[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")**
- [![jouwnaambord.nl's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile") Topic Author
- [ Offline](/forum/user/1188-jouwnaambord-nl)

Less More

- Posts: 515
- Thank you received: 22
-
-

10 years 3 months ago [\#246538](#246538) by [jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")  Replied by *[jouwnaambord.nl](/forum/user/1188-jouwnaambord-nl "View jouwnaambord.nl's Profile")* on topic *[changing customeraddress in backend database error](/forum/35-orders-management/885769-changing-customeraddress-in-backend-database-error#246538 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.5.9  Hi,  When I change an address (billing or shipping) in an existing or new order, the address&#95;user&#95;id in the database stays empty (0) instead of being updated with the user&#95;id. Could this be a bug?  Michel")*

Hi,

No, of course it shouldn't. But it does. When editing the address as admin in the backend in an order a new address_id is made in the database. The user_id in this new addressfield is set to 0 by the system, see both screenshots.

- [ ![hika&#95;address.jpg](/forum/attachment/32828) ](/forum/attachment/32828 "hika&#95;address.jpg") [ ](/forum/attachment/32828?download=1 "hika&#95;address.jpg")
- [ ![hika&#95;address-database.jpg](/forum/attachment/32829) ](/forum/attachment/32829 "...s-database.jpg") [ ](/forum/attachment/32829?download=1 "...s-database.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTc2OS1jaGFuZ2luZy1jdXN0b21lcmFkZHJlc3MtaW4tYmFja2VuZC1kYXRhYmFzZS1lcnJvcj90bXBsPW1hcmtkb3du) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

10 years 3 months ago [\#246602](#246602) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[changing customeraddress in backend database error](/forum/35-orders-management/885769-changing-customeraddress-in-backend-database-error#246602 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6 -- PHP version -- : 5.5.9  Hi,  When I change an address (billing or shipping) in an existing or new order, the address&#95;user&#95;id in the database stays empty (0) instead of being updated with the user&#95;id. Could this be a bug?  Michel")*

Hi,

Ok, I see what's wrong.
Please add the line:
$billing_address-&gt;address_user_id = $oldAddress-&gt;address_user_id;
before:
$result = $addressClass-&gt;save($billing_address, $order_id, 'billing');
and the line:
$shipping_address-&gt;address_user_id = $oldAddress-&gt;address_user_id;
before:
$result = $addressClass-&gt;save($shipping_address, $order_id, 'shipping');
in the file administrator/components/com_hikashop/classes/order.php and that will fix the problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg4NTc2OS1jaGFuZ2luZy1jdXN0b21lcmFkZHJlc3MtaW4tYmFja2VuZC1kYXRhYmFzZS1lcnJvcj90bXBsPW1hcmtkb3du) 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.052 seconds

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