# Bezeichnung der Promotion ausgeben

**URL:** <https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034>\
**Category:** Shopware 3.5\
**Tags:** templates--design\
**Created:** [8. November 2011 um 12:51 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034 "2011-11-08T12:51:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatKor](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MatKor](https://forum.shopware.com/u/MatKor)\
**Post date:** [8. November 2011 um 12:51 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/1 "2011-11-08T12:51:03Z")

</div>

Hallo zusammen, ich habe in den Einkauswelten 5 Promotionsartikel für die Startseite fest angelegt. Jede Promotion hat eine eigene Bezeichnung. Ist es möglich diese Beschreibung im Frontend mit ausgeben zu lassen? Dass also zuerst die Beschreibung “Schnäppchen für XY” in der Artikelbox über dem eigentlichen Artikel erscheint? Gruß

---

<div class="post-metadata">

**Author:** ![MatKor](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MatKor](https://forum.shopware.com/u/MatKor)\
**Post date:** [14. November 2011 um 17:39 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/2 "2011-11-14T17:39:21Z")

</div>

Hat denn keiner eine Idee?

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [15. November 2011 um 08:33 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/3 "2011-11-15T08:33:33Z")

</div>

Um welche Art Promotion handelt es sich? Image, Text, Artikel etc. Du bekommst due Bescheibung immer über {$arrayname.description} z.B. Promotion Image listing/promotion\_image.tpl [code] {\* Promotion image \*} {block name=“frontend\_listing\_promotion\_image”}

[![{$sArticle.description}]( "{$sArticle.description}")]({if $sArticle.link}{$sArticle.link}{else}#{/if})  
{/block} [/code] {$sArticle.description}

---

<div class="post-metadata">

**Author:** ![MatKor](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MatKor](https://forum.shopware.com/u/MatKor)\
**Post date:** [15. November 2011 um 09:53 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/4 "2011-11-15T09:53:12Z")

</div>

Hallo, Marketing -\> Einkaufswelten -\> Deutsch -\> Fester Artikel Beim Anlegen einer Promotion, habe ich dann bei der Bezeichnung „Schnäppchen für den Hund“ und bei der nächsten Promotion „Schnäppchen für die Katze“ als Bezeichnung eingetragen. Und diese Bezeichnungen würde ich gerne mit ausgeben lassen.

---

<div class="post-metadata">

**Author:** ![MatKor](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@MatKor](https://forum.shopware.com/u/MatKor)\
**Post date:** [24. November 2011 um 17:03 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/5 "2011-11-24T17:03:45Z")

</div>

Als Workaround habe ich das erstmal folgendermaßen gelöst: Beim Artikelimport habe ich anhand der Kategorie des Artikels einfach ein Freifeldtext verwendet um meine Promotionsbezeichnung z.B. „Schnäppchen für den Hund“ unterzubringen. Wenn mit diesen Artikeln nun eine Promotion angelegt wird, wird in der box\_article\_promotion.tpl zusätzlich das Freitextfeld über dem Artikelbild ausgegeben. Ist zwar nicht ganz optimal, aber für’s erste funktioniert das erstmal.

---

<div class="post-metadata">

**Author:** ![site-concept](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@site-concept](https://forum.shopware.com/u/site-concept)\
**Post date:** [13. Juni 2012 um 13:10 UTC](https://forum.shopware.com/t/bezeichnung-der-promotion-ausgeben/5034/6 "2012-06-13T13:10:27Z")

</div>

Alternativ kann man auch die Funktion “sGetPromotions” in “/engine/core/class/sArticles.php” anpassen (ca. Zeile 4006). Dann hat man im Template eine weitere Variable zur Verfügung {$sArticle.promotiontitle} Hier der Code für die angepasste Funktion: ` /\*\* \* Get list of all promotions from a certain category \* @param int $category category id \* @access public \* @return array \*/ public function sGetPromotions($category){ $category = intval($category); $sToday = date("Y-m-d"); /\*$sql = " SELECT category,mode, TRIM(ordernumber) as ordernumber, link, description, link\_target, img, liveshoppingID FROM s\_emarketing\_promotions WHERE category=$category AND ((TO\_DAYS(valid\_from) \<= TO\_DAYS('$sToday') AND TO\_DAYS(valid\_to) \>= TO\_DAYS('$sToday')) OR (valid\_from='0000-00-00' AND valid\_to='0000-00-00')) ORDER BY position ASC ";\*/ /\* Site Concept 13.06.2012 \*/ $sql = " SELECT description as promotiontitle,category,mode, TRIM(ordernumber) as ordernumber, link, description, link\_target, img, liveshoppingID FROM s\_emarketing\_promotions WHERE category=$category AND ((TO\_DAYS(valid\_from) \<= TO\_DAYS('$sToday') AND TO\_DAYS(valid\_to) \>= TO\_DAYS('$sToday')) OR (valid\_from='0000-00-00' AND valid\_to='0000-00-00')) ORDER BY position ASC "; $sql = Enlight()-\>Events()-\>filter('Shopware\_Modules\_Articles\_GetPromotions\_FilterSQL', $sql, array('subject'=\>$this,'category'=\>$category)); $getAffectedPromitions = $this-\>sSYSTEM-\>sDB\_CONNECTION-\>GetAll($sql); // Clearing cache unset($this-\>sCachePromotions); if (count($getAffectedPromitions)){ $counter = 0; /\* Site Concept 13.06.2012 \*/ foreach ($getAffectedPromitions as $promotion){ $promotionTitle = $promotion['promotiontitle']; /\* Site Concept 13.06.2012 \*/ switch ($promotion["mode"]){ case "random": $promotion = $this-\>sGetPromotionById ("random",$category); if (count($promotion)\>1) $promote[$counter] = $promotion; break; case "fix": $promotion = $this-\>sGetPromotionById ("fix",$category,$promotion["ordernumber"]); if (count($promotion)\>1) $promote[$counter] = $promotion; break; case "new": $promotion = $this-\>sGetPromotionById ("new",$category); if (count($promotion)\>1) $promote[$counter] = $promotion; break; case "top": $promotion = $this-\>sGetPromotionById ("top",$category); if (count($promotion)\>1) $promote[$counter] = $promotion; break; case "gfx": $promotion = $this-\>sGetPromotionById ("gfx",$category,$promotion); if (count($promotion)\>1) $promote[$counter] = $promotion; break; case "livefix": $promotion = $this-\>sGetLiveShopping('fix', 0, $promotion, true); $promotion['liveshoppingData'] = $promotion['liveshoppingData'][0]; if (count($promotion)\>1 && !empty($promotion['liveshoppingData'])) $promote[$counter] = $promotion; break; case "liverand": $cacheSQL = null; if (!empty($this-\>sCachePromotions)){ $cacheSQL = 'AND lv.articleID NOT IN ('.implode(', ',$this-\>sCachePromotions).')'; } $promotion = $this-\>sGetLiveShopping('random', 0, $promotion, true, $cacheSQL); if (!empty($promotion['liveshoppingData'][0])) { $promotion['liveshoppingData'] = $promotion['liveshoppingData'][0]; $promote[$counter] = $promotion; } break; case "liverandcat": $cacheSQL = null; if (!empty($this-\>sCachePromotions)){ $cacheSQL = 'AND lv.articleID NOT IN ('.implode(', ',$this-\>sCachePromotions).')'; } $promotion = $this-\>sGetLiveShopping('random', $category, $promotion, true, $cacheSQL); if (!empty($promotion['liveshoppingData'][0])) { $promotion['liveshoppingData'] = $promotion['liveshoppingData'][0]; $promote[$counter] = $promotion; } break; } // end switch $promote[$counter]['promotiontitle'] = $promotionTitle; /\* Site Concept 13.06.2012 \*/ $counter++; /\* Site Concept 13.06.2012 \*/ } // end foreach $promote = Enlight()-\>Events()-\>filter('Shopware\_Modules\_Articles\_GetPromotions\_FilterResult', $promote, array('subject'=\>$this,'category'=\>$category)); return $promote; } // end if } // end function `
