# 1 Cent Artikel

**URL:** <https://forum.shopware.com/t/1-cent-artikel/16811>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [16. November 2013 um 13:52 UTC](https://forum.shopware.com/t/1-cent-artikel/16811 "2013-11-16T13:52:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [16. November 2013 um 13:52 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/1 "2013-11-16T13:52:42Z")

</div>

Hallo ich möchte mir ein kleines Plugin machen und zwar möchte ich das Alle Aktikel die nur 0,01 € kosten ein Extra logo erstellt Wie mach ich die IF Abfrage in Bootstab.php ist das möglich? gruß Mattes

---

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [28. November 2013 um 15:23 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/2 "2013-11-28T15:23:30Z")

</div>

Ich suche nur die IF abfrage ` if ( Shopware()-\>????()-\>????()-\>====()=="0,01" ) { } ` Weiß jemand wie man die Preise Abfragen kann? gruß Mattes

---

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [30. November 2013 um 16:34 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/3 "2013-11-30T16:34:27Z")

</div>

In Template ist die abfrage wie ich im Forum gelesen habe so. `{if $sArticle.price=="0,01"}` Ich kann ich diese Abfrage in Bootstrap.php machen? gruß Mattes

---

<div class="post-metadata">

**Author:** ![marioford](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@marioford](https://forum.shopware.com/u/marioford)\
**Post date:** [1. Dezember 2013 um 10:59 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/4 "2013-12-01T10:59:21Z")

</div>

Hallo, Du musst dir erst den View holen. Dann hast du alle Template Variablen zur Verfügung. Zum Beispiel auf der Detailseite. Event: $this-\>subscribeEvent( ‚Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Detail‘, ‚onPostDispatchDetail‘ ); in der Methode onPostDispatchDetail: $controller = $args-\>getSubject(); $view = $controller-\>View(); dann: $article = $view-\>sArticle; if ($article[„price“] == ‚0,01‘) { bla bla }

---

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [31. Dezember 2013 um 12:19 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/5 "2013-12-31T12:19:20Z")

</div>

Hallo Ich hab ein Problem ich bin grad dabei mein Test Plugin zu machen. Leider geht meine Abfrage nicht. ` $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Listing', 'TestListing' ); $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Detail', 'TestDetail' public function TestListing(Enlight\_Event\_EventArgs $arguments) { /\*\*@var $controller Shopware\_Controllers\_Frontend\_Index\*/ $controller = $arguments-\>getSubject(); $view = $controller-\>View(); //Add our plugin template directory to load our slogan extension. $view-\>addTemplateDir($this-\>Path() . 'Views/'); $article = $view-\>sArticle; if ($article["price"] == '0.01') { $view-\>extendsTemplate('listing/box\_article1.tpl'); $view-\>extendsTemplate('listing/box\_similar1.tpl'); } } public function TestDetail(Enlight\_Event\_EventArgs $arguments) { /\*\*@var $controller Shopware\_Controllers\_Frontend\_Index\*/ $controller = $arguments-\>getSubject(); $view = $controller-\>View(); //Add our plugin template directory to load our slogan extension. $view-\>addTemplateDir($this-\>Path() . 'Views/'); $article = $view-\>sArticle; if ($article["price"] == '0.01') { $view-\>extendsTemplate('detail/data1.tpl'); } } ` ist die Abfrage if ($article[“price”] == ‘0.01’) so richtig? gruß Mattes

---

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [31. Dezember 2013 um 19:23 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/6 "2013-12-31T19:23:38Z")

</div>

In Detail hab ich es hinbekommen ich hab hier den code `$sArticle = $view-\>getAssign('sArticle');` und die abfrage `if ( $sArticle['price'] == '0,01')` aber in Listing geht das nicht Warum geht dieser code nicht bei Listing, was muss man da ändern?

---

<div class="post-metadata">

**Author:** ![mattes80](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mattes80](https://forum.shopware.com/u/mattes80)\
**Post date:** [3. Januar 2014 um 14:07 UTC](https://forum.shopware.com/t/1-cent-artikel/16811/7 "2014-01-03T14:07:21Z")

</div>

Hallo Ich hab mal mein Code zusammen geschrieben. Was hab ich da Falsch gemacht? Kann mir bitte jemand weiterhelfen? ` $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Listing', 'TestListing' ); public function TestListing(Enlight\_Event\_EventArgs $arguments) { /\*\*@var $controller Shopware\_Controllers\_Frontend\_Index\*/ $controller = $arguments-\>getSubject(); $view = $controller-\>View(); //Add our plugin template directory to load our slogan extension. $view-\>addTemplateDir($this-\>Path() . 'Views/'); $sArticle = $view-\>getAssign('sArticle'); if ($article["price"] == '0.01') { $view-\>extendsTemplate('listing/box\_article1.tpl'); $view-\>extendsTemplate('listing/box\_similar1.tpl'); } } `
