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

#   Address template $this-&gt;address is empty

##

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

Less More

- Posts: 52
- Thank you received: 6
-
-

5 years 9 months ago -  5 years 9 months ago [\#328794](#328794) by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile")  *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328794 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")* was created by *[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")*

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.3.26
-- Browser(s) name and version -- : Firefox

The default code in address is
{address_company}
{address_title} {address_firstname} {address_lastname}
{address_street}
{address_post_code} {address_city} {address_state}
{address_country}
&lt;?php if(!empty($this-&gt;address-&gt;address_telephone)) echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}');?&gt;

The telephone has been set but never gets displayed.
If you use print_r to find out the contents of 'address', it is not set. If you print_r $this, 'address' is defined but with nothing in it.

How do we resolve so the logic works? I wish to use on other address fields.

Thank you
David

Last edit: 5 years 9 months ago by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy85MDE3NTctYWRkcmVzcy10ZW1wbGF0ZS10aGlzLWFkZHJlc3MtaXMtZW1wdHk/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
-
-

5 years 9 months ago [\#328798](#328798) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328798 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Hi,

$this-&gt;address is actually available on my end. I suppose it depends on where you're looking at it.
I've actually checked a bit the code behind it and I think I know what is going on.
I've added a patch so that it set $this-&gt;address in all cases.
Could you please download again the install package of the 4.4.0 on our website and install it again on yours ? It will add the patch which should hopefully fix the problem for you.
Otherwise, we'll need more information on where you're testing your code change

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

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

Less More

- Posts: 52
- Thank you received: 6
-
-

5 years 9 months ago [\#328830](#328830) by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile")  Replied by *[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328830 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Afternoon
Great that has worked.
Just so you are aware, empty optional address fields use to not show in displayed address. Now they give blank lines.
I have added php logic in my address template to hide empty optional lines, so not a problem to me.

Address view. I use to have two columns of addresses, but now I have one column, with each address saying billing and/or shipping in the bottom right corner. I'm not sure how you set which type it is, as there are no options to set in the edit screen. Have I missed a change or I have I changed a setting for the layout without realising?

Thank you for quick response.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy85MDE3NTctYWRkcmVzcy10ZW1wbGF0ZS10aGlzLWFkZHJlc3MtaXMtZW1wdHk/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
-
-

5 years 9 months ago [\#328832](#328832) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328832 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Hi,

I'm not sure what you're talking about.
The same address format is used for both address types.
In $this-&gt;address-&gt;address_type you'll find the type of the address if you need to have conditions based on the address type.

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

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

Less More

- Posts: 52
- Thank you received: 6
-
-

5 years 9 months ago [\#328881](#328881) by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile")  Replied by *[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328881 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Morning
I have had another look this morning after putting the system live over the weekend. The live setup was a copy of the development environment.
In live I got View2. In development I got view1. It does not matter if I go in through the profile cpanel or through an address menu.

I have just tried development again but viewing with the same user as live. I get View2, the same as live. It suggests it is something about the user. But I am not aware I changed anything on the user?

I prefer View2.

Thank you
David

- [ ![view2.png](/forum/attachment/51794) ](/forum/attachment/51794 "view2.png") [ ](/forum/attachment/51794?download=1 "view2.png")
- [ ![view1.png](/forum/attachment/51795) ](/forum/attachment/51795 "view1.png") [ ](/forum/attachment/51795?download=1 "view1.png")

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

5 years 9 months ago -  5 years 9 months ago [\#328889](#328889) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328889 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Hello,

We will need to see this issue by ourselves, please.
So provide an **Url link**, a test **user references** and a **step by step process** in order to be able to experience your issue.

Please, use our **[ Contact us](https://www.hikashop.com/support/contact-us.html)** form to provide these elements, and don't forget to add an **Url link to this topic**.
Awaiting your elements to be able to progress on your subject.
Regards

Last edit: 5 years 9 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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

Less More

- Posts: 52
- Thank you received: 6
-
-

5 years 9 months ago [\#328955](#328955) by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile")  Replied by *[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")* on topic *[Address template $this-&gt;address is empty](/forum/33-customers/901757-address-template-this-address-is-empty#328955 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.24 -- PHP version -- : 7.3.26 -- Browser(s) name and version -- : Firefox  The default code in address is {address&#95;company} {address&#95;title} {address&#95;firstname} {address&#95;lastname} {address&#95;street} {address&#95;post&#95;code} {address&#95;city} {address&#95;state} {address&#95;country} address-&gt;address&#95;telephone)) echo JText::sprintf('TELEPHONE&#95;IN&#95;ADDRESS','{address&#95;telephone}');?&gt;  The telephone has been set but never gets displayed. If you use print&#95;r to find out the contents of 'address', it is not set. If you print&#95;r $this, 'address' is defined but with nothing in it.  How do we resolve so the logic works? I wish to use on other address fields.  Thank you David")*

Afternoon

I just went into the account to set the password for you and then viewed the account address to see the issue was still there. However, the address view has returned to the usual two-column layout. So I cannot send you an example at this time, as the account that was providing a different layout, now isn't. Confused as I haven't changed anything other than name and password.

If it comes back, I will send you the link.

Thank you
David

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

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