# Text nicht anzeigen lassen wenn keiner vorhanden ist

**URL:** <https://forum.shopware.com/t/text-nicht-anzeigen-lassen-wenn-keiner-vorhanden-ist/41174>\
**Category:** Programmierung\
**Created:** [8. November 2016 um 03:16 UTC](https://forum.shopware.com/t/text-nicht-anzeigen-lassen-wenn-keiner-vorhanden-ist/41174 "2016-11-08T03:16:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![malakiras](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@malakiras](https://forum.shopware.com/u/malakiras)\
**Post date:** [8. November 2016 um 03:16 UTC](https://forum.shopware.com/t/text-nicht-anzeigen-lassen-wenn-keiner-vorhanden-ist/41174/1 "2016-11-08T03:16:32Z")

</div>

Hallo Leute

Ich habe ein Email Layout und da gebe ich die Rechnungsadresse aus. Alles schön und gut, jedoch habe ich manchmal eine Firma als Kunde und manchmal nicht.&nbsp;

Ich habe nun die Problematik das ich die Firma ausgeben lassen will aber nur wenn auch eine vorhanden ist.&nbsp;

Wie bekomme ich das hin? Mit if else? Falls ja weiß ich nicht genau wie es funktioniert.&nbsp;

Aktuell sieht der Code so aus:

|

&nbsp;{$shippingaddress.company}  
{$shippingaddress.firstname} {$shippingaddress.lastname}  
{$shippingaddress.street}  
{$shippingaddress.zipcode} {$shippingaddress.city}  
{$additional.country.countryname}

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

|  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

* * *

&nbsp;{$shippingaddress.company} &nbsp; sollte in diesem Fall nur ausgegeben werden, wenn es auch eine Firma gibt.&nbsp;

PS: Wenn keine Firma ausgegeben wird habe ich eine Lücke und das sieht nicht schön aus, deswegen möchte ich dieses Problem lösen.

Wäre super wenn ihr mir helfen könntet.&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![sschreier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sschreier/32/23296_2.png) [@sschreier](https://forum.shopware.com/u/sschreier)\
**Post date:** [8. November 2016 um 07:32 UTC](https://forum.shopware.com/t/text-nicht-anzeigen-lassen-wenn-keiner-vorhanden-ist/41174/2 "2016-11-08T07:32:59Z")

</div>

> [@malakiras schrieb:](https://forum.shopware.com/profile/23847/malakiras "malakiras")
> 
> Hallo Leute
> 
> Ich habe ein Email Layout und da gebe ich die Rechnungsadresse aus. Alles schön und gut, jedoch habe ich manchmal eine Firma als Kunde und manchmal nicht.&nbsp;
> 
> Ich habe nun die Problematik das ich die Firma ausgeben lassen will aber nur wenn auch eine vorhanden ist.&nbsp;
> 
> Wie bekomme ich das hin? Mit if else? Falls ja weiß ich nicht genau wie es funktioniert.&nbsp;
> 
> Aktuell sieht der Code so aus:
> 
> &nbsp;
> 
> &nbsp;
> 
> &nbsp;{$shippingaddress.company}  
> {$shippingaddress.firstname} {$shippingaddress.lastname}  
> {$shippingaddress.street}  
> {$shippingaddress.zipcode} {$shippingaddress.city}  
> {$additional.country.countryname}
> 
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;  
> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
> 
> * * *
> 
> &nbsp;{$shippingaddress.company} &nbsp; sollte in diesem Fall nur ausgegeben werden, wenn es auch eine Firma gibt.&nbsp;
> 
> PS: Wenn keine Firma ausgegeben wird habe ich eine Lücke und das sieht nicht schön aus, deswegen möchte ich dieses Problem lösen.
> 
> Wäre super wenn ihr mir helfen könntet.&nbsp;
> 
> &nbsp;

Hallo,

du könntest beispielsweise prüfen, ob das Feld ungleich leer ist:

```
{if $shippingaddress.company != ""}{$shippingaddress.company}{/if}

```

Beste Grüße

Sebastian
