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

#   Telephone in Address

##

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 645
- Thank you received: 26
-
-
-

6 years 6 months ago [\#319330](#319330) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  *[Telephone in Address](/forum/30-integrations/899906-telephone-in-address#319330 "-- HikaShop version -- : 4.3.0  Hi Hikashop,  Is it possible to change this code in the address format so that it wil only used when a telephone number has been provided by the customer. Because we don't have this field required.  Kind regards, Lumiga")* was created by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")*

-- HikaShop version -- : 4.3.0

Hi Hikashop,

Is it possible to change this code in the address format so that it wil only used when a telephone number has been provided by the customer.
Because we don't have this field required.
Code:

&lt;?php echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}');?&gt;

Kind regards,
Lumiga

---

Kind regards,
Lumiga

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84OTk5MDYtdGVsZXBob25lLWluLWFkZHJlc3M/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: 86587
- Thank you received: 14325
-
-

6 years 6 months ago [\#319339](#319339) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Telephone in Address](/forum/30-integrations/899906-telephone-in-address#319339 "-- HikaShop version -- : 4.3.0  Hi Hikashop,  Is it possible to change this code in the address format so that it wil only used when a telephone number has been provided by the customer. Because we don't have this field required.  Kind regards, Lumiga")*

Hi,

Yes. You want to do it like that: Code:

&lt;?php $address = $this-&gt;params-&gt;get('address'); if(!empty($address-&gt;address_telephone)) { echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}'); } ?&gt;

The following user(s) said Thank You: [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")

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

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 645
- Thank you received: 26
-
-
-

5 years 7 months ago -  5 years 7 months ago [\#331325](#331325) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  Replied by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")* on topic *[Telephone in Address](/forum/30-integrations/899906-telephone-in-address#331325 "-- HikaShop version -- : 4.3.0  Hi Hikashop,  Is it possible to change this code in the address format so that it wil only used when a telephone number has been provided by the customer. Because we don't have this field required.  Kind regards, Lumiga")*

Hi Nicolas,

I saw that you changed the code in version 4.4.0 from:
Code:

&lt;?php $address = $this-&gt;params-&gt;get('address'); if(!empty($address-&gt;address_telephone)) { echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}'); } ?&gt;

to
Code:

&lt;?php if(!empty($this-&gt;address-&gt;address_telephone)) echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}');?&gt;

Do you recommend using the new code or should the old one still work?

I have also create a code for the VAT in the address, maybe a good idea for a next version ![;-)](/media/kunena/emoticons/24.png ";-)") ?
Code:

&lt;?php $address = $this-&gt;params-&gt;get('address'); if(!empty($address-&gt;address_vat)) { echo JText::sprintf('VAT_IN_ADDRESS','{address_vat}'); } ?&gt;

---

Kind regards,
Lumiga

Last edit: 5 years 7 months ago by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84OTk5MDYtdGVsZXBob25lLWluLWFkZHJlc3M/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: 86587
- Thank you received: 14325
-
-

5 years 7 months ago [\#331327](#331327) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Telephone in Address](/forum/30-integrations/899906-telephone-in-address#331327 "-- HikaShop version -- : 4.3.0  Hi Hikashop,  Is it possible to change this code in the address format so that it wil only used when a telephone number has been provided by the customer. Because we don't have this field required.  Kind regards, Lumiga")*

Hi,

The old code will still work. We've just set $this-&gt;address with the value of $this-&gt;params-&gt;get('address') so that you can directly tap into the address without a line of code to get the variable.
But yes, we could add the VAT number by default if filled in. That would simplify things for merchants using that custom field.

The following user(s) said Thank You: [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")

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

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