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ß
Hat denn keiner eine Idee?
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”}
[]({if $sArticle.link}{$sArticle.link}{else}#{/if})
{/block} [/code] {$sArticle.description}
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.
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.
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