Address Class

  • Posts: 137
  • Thank you received: 2
12 years 10 months ago #41361

Hi,

when i am generating the emails for the user status notification, i am trying to retrieve the address so as to include it in the email. So i do the following:

$addressClass = hikashop_get('class.address');
$address = $addressClass->get($dbOrder->order_user_id); //and i know the user_id at this point

and the i am trying to access the address table with:

$address->address_firstname;

but this returns an empty address with no error created.

Could you please suggest an approach that could work.

Thank you in advance.

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

  • Posts: 83103
  • Thank you received: 13416
  • MODERATOR
12 years 10 months ago #41544

Hi,

$dbOrder->order_user_id is the id of the user, not the id of the address.
For the address, you should use that:
$dbOrder->order_billing_address_id

so have your code like that:
$addressClass = hikashop_get('class.address');
$address = $addressClass->get($dbOrder->order_billing_address_id);

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

  • Posts: 137
  • Thank you received: 2
12 years 10 months ago #41657

Thank you Nicolas,

your suggestion is very helpful.
Thanks again.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum