# IF ELSE Abfrage in Google Shopping Export Feed

**URL:** <https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592>\
**Category:** Administration\
**Created:** [4. Mai 2017 um 15:17 UTC](https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592 "2017-05-04T15:17:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![icedoutbiz](https://avatars.discourse-cdn.com/v4/letter/i/b782af/32.png) [@icedoutbiz](https://forum.shopware.com/u/icedoutbiz)\
**Post date:** [4. Mai 2017 um 15:17 UTC](https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592/1 "2017-05-04T15:17:59Z")

</div>

Hallo,

wie kann eine IF ELSE Abfrage im XML Feed erstellen?

zum Beispiel für SALE PRICE:

Wenn {$sArticle.price|format:“number”} nicht leer dann {$sArticle.pseudoprice}

&nbsp;

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [4. Mai 2017 um 17:01 UTC](https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592/2 "2017-05-04T17:01:42Z")

</div>

Schau dir doch mal die Smarty-Dokumentation dazu an: [http://www.smarty.net/docsv2/de/language.function.if.tpl](http://www.smarty.net/docsv2/de/language.function.if.tpl)

Ist kein Hexenwerk 🙂

---

<div class="post-metadata">

**Author:** ![ewuemoht](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@ewuemoht](https://forum.shopware.com/u/ewuemoht)\
**Post date:** [5. Mai 2017 um 13:34 UTC](https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592/3 "2017-05-05T13:34:01Z")

</div>

Beispiel aus unserem Feed:

{if $sArticle.purchaseunit \>= 1}{$sArticle.purchaseunit|string\_format:"%d"}{else}1{/if} x {if $sArticle.attr14}{$sArticle.attr14}{else}{$sArticle.name|strip\_tags|strip|truncate:80:"...":true|escape}{/if}

---

<div class="post-metadata">

**Author:** ![icedoutbiz](https://avatars.discourse-cdn.com/v4/letter/i/b782af/32.png) [@icedoutbiz](https://forum.shopware.com/u/icedoutbiz)\
**Post date:** [7. Mai 2017 um 23:13 UTC](https://forum.shopware.com/t/if-else-abfrage-in-google-shopping-export-feed/45592/4 "2017-05-07T23:13:07Z")

</div>

Vielen Dank, hat funktioniert.
