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

#   Address Class

##

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

Less More

- Posts: 137
- Thank you received: 2
-
-

14 years 8 months ago [\#41361](#41361) by [emergentec](/forum/user/949-emergentec "View emergentec's Profile")  *[Address Class](/forum/4-how-to/41361-address-class#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&#95;get('class.address'); $address = $addressClass-&gt;get($dbOrder-&gt;order&#95;user&#95;id); //and i know the user&#95;id at this point  and the i am trying to access the address table with:  $address-&gt;address&#95;firstname;  but this returns an empty address with no error created.  Could you please suggest an approach that could work.  Thank you in advance.")* was created by *[emergentec](/forum/user/949-emergentec "View emergentec's Profile")*

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-&gt;get($dbOrder-&gt;order_user_id); //and i know the user_id at this point

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

$address-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQxMzYxLWFkZHJlc3MtY2xhc3M/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

14 years 8 months ago [\#41544](#41544) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Address Class](/forum/4-how-to/41361-address-class#41544 "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&#95;get('class.address'); $address = $addressClass-&gt;get($dbOrder-&gt;order&#95;user&#95;id); //and i know the user&#95;id at this point  and the i am trying to access the address table with:  $address-&gt;address&#95;firstname;  but this returns an empty address with no error created.  Could you please suggest an approach that could work.  Thank you in advance.")*

Hi,

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

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

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

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

Less More

- Posts: 137
- Thank you received: 2
-
-

14 years 8 months ago [\#41657](#41657) by [emergentec](/forum/user/949-emergentec "View emergentec's Profile")  Replied by *[emergentec](/forum/user/949-emergentec "View emergentec's Profile")* on topic *[Re: Address Class](/forum/4-how-to/41361-address-class#41657 "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&#95;get('class.address'); $address = $addressClass-&gt;get($dbOrder-&gt;order&#95;user&#95;id); //and i know the user&#95;id at this point  and the i am trying to access the address table with:  $address-&gt;address&#95;firstname;  but this returns an empty address with no error created.  Could you please suggest an approach that could work.  Thank you in advance.")*

Thank you Nicolas,

your suggestion is very helpful.
Thanks again.

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

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