# If-Abfrage ShopID

**URL:** <https://forum.shopware.com/t/if-abfrage-shopid/30920>\
**Category:** Themes & Design\
**Created:** [28. September 2015 um 09:56 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920 "2015-09-28T09:56:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goethe](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@Goethe](https://forum.shopware.com/u/Goethe)\
**Post date:** [28. September 2015 um 09:56 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920/1 "2015-09-28T09:56:33Z")

</div>

Guten Morgen, ich würde gerne folgende if-Abfrage nutzen, leider klappt es nicht: ` {if ShopID = 2} {block name="frontend\_detail\_buy"} {/block} {/if}` Quasi, wenn Shop mit ID 2 angesprochen wird, soll der bestellen Button ausgeblendet werden. Ausgeblendet wird er, jedoch in allen Shops 😃

---

<div class="post-metadata">

**Author:** ![Simon\_Baumer](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@Simon\_Baumer](https://forum.shopware.com/u/Simon_Baumer)\
**Post date:** [28. September 2015 um 10:00 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920/2 "2015-09-28T10:00:06Z")

</div>

[quote=„Goethe“]Guten Morgen, ich würde gerne folgende if-Abfrage nutzen, leider klappt es nicht: ` {if ShopID = 2} {block name="frontend\_detail\_buy"} {/block} {/if}` Quasi, wenn Shop mit ID 2 angesprochen wird, soll der bestellen Button ausgeblendet werden. Ausgeblendet wird er, jedoch in allen Shops :D[/quote] Guten Morgen Goethe, die If Abfrage ist falsch, du musst mit 2 Gleichheitszeichen überprüfen. So weißt du der Variable ShopID den Wert 2 zu. Richtig wäre es so: ` {if ShopID == 2} {block name="frontend\_detail\_buy"} {/block} {/if}` Gruß, Simon

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [28. September 2015 um 10:04 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920/3 "2015-09-28T10:04:52Z")

</div>

Auch das ist falsch 😛 Richtig wäre: ` {block name="frontend\_detail\_buy"} {if $shopID != 2} {$smarty.block.parent} {/if} {/block} ` Viele Grüße

---

<div class="post-metadata">

**Author:** ![Goethe](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@Goethe](https://forum.shopware.com/u/Goethe)\
**Post date:** [28. September 2015 um 10:22 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920/4 "2015-09-28T10:22:51Z")

</div>

[quote=„Aquatuning GmbH“]Auch das ist falsch 😛 Richtig wäre: ` {block name="frontend\_detail\_buy"} {if $shopID != 2} {$smarty.block.parent} {/if} {/block} ` Viele Grüße[/quote] Klappt leider auch nicht ☹

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [28. September 2015 um 10:55 UTC](https://forum.shopware.com/t/if-abfrage-shopid/30920/5 "2015-09-28T10:55:07Z")

</div>

Gibt es denn $shopID überhaupt?! Viele Grüße
