changing customeraddress in backend database error

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
8 years 3 months ago #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_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 or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 3 months ago #246463

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 or Create an account to join the conversation.

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
8 years 3 months ago #246538

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.

Attachments:

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 3 months ago #246602

Hi,

Ok, I see what's wrong.
Please add the line:
$billing_address->address_user_id = $oldAddress->address_user_id;
before:
$result = $addressClass->save($billing_address, $order_id, 'billing');
and the line:
$shipping_address->address_user_id = $oldAddress->address_user_id;
before:
$result = $addressClass->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 or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum