# Trusted Shop Bewertungen als Rich Snippet in  footer.tpl

**URL:** <https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558>\
**Category:** Shopware 3.5\
**Tags:** other\
**Created:** [13. November 2014 um 17:35 UTC](https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558 "2014-11-13T17:35:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benji89](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@Benji89](https://forum.shopware.com/u/Benji89)\
**Post date:** [13. November 2014 um 17:35 UTC](https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558/1 "2014-11-13T17:35:01Z")

</div>

Moin alle Zusammen, ich möchte gerne in meine Shopware 4.1.0 footer.tpl Datei wie hier beschrieben: [Link zum alten SW 3.5 Thema](http://forum.shopware.com/administration-f11/trusted-shop-bewertungen-als-rich-snippet-bei-google-t5764.html) folgenden Code einfügen. [code]{php} $tsId = „TRUSTEDSHOPS-ID“; if ($xml = simplexml\_load\_file(„[https://www.trustedshops.com/bewertung/show\_xml.php?tsid=](https://www.trustedshops.com/bewertung/show_xml.php?tsid=)“.$tsId)) { $result = $xml-\>ratings-\>result[1]; $max = „5.00“; $count = $xml-\>ratings[„amount“]; echo "

Kundenbewertungen von Trusted Shops: „.$result.“ / „.$max.“ bei „.$count.“ Bewertungen

"; } {/php}[/code] Allerdings bekomme ich hier eine Fehlermeldung. Was ich schon rausgefunden habe ist, dass man den Code am besten so schreibt: `<?php $tsId = "XXXXXXXXXXXXXXXXXXX";
if ($xml = simplexml_load_file("https://www.trustedshops.com/bewertung/show_xml.php?tsid=".$tsId)) {
$result = $xml->ratings-\>result[1]; $max = "5.00"; $count = $xml-\>ratings["amount"];?\>[Kundenbewertungen von Trusted Shops](http://www.trustedshops.de/shop-info/trusted-shops-kundenbewertungen/):=$result;?\> / =$max;?\> bei =$count;?\> [Bewertungen](https://www.trustedshops.de/bewertung/info_<?=$tsId?>.html)<?php }?>` und ihn über SMARTY (keien Ahnung was das ist) aus der footet.tpl auslagert und dann über `include file='PFAD'` wieder einfügt… leider kann der Code jedoch nicht sauber angewand werden. Ergebnis: `xpath($xPath)[0]; $max = "5.00"; $count = $xml-\>ratings["amount"]; $shopName = $xml-\>name; $xmlFound = true; } if ($xmlFound) { ?\> Trusted Shops seller rating: / of bewertungen"\> ratings ` oder siehe meine Seite ganz unten: [http://www.secret-of-health.de](http://www.secret-of-health.de/) Hat hier jemand eine Idee ich bekomme es leider nicht zum laufen. Danke! mfg, Benni

---

<div class="post-metadata">

**Author:** ![Moto-Act](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Moto-Act](https://forum.shopware.com/u/Moto-Act)\
**Post date:** [21. November 2014 um 01:26 UTC](https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558/2 "2014-11-21T01:26:09Z")

</div>

das interessiert mich auch, wie das funktioniert:shopware:

---

<div class="post-metadata">

**Author:** ![SebastianKloepper](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sebastiankloepper/32/21435_2.png) [@SebastianKloepper](https://forum.shopware.com/u/SebastianKloepper)\
**Post date:** [21. November 2014 um 10:38 UTC](https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558/3 "2014-11-21T10:38:02Z")

</div>

Hallo, also PHP direkt im Shopware template ist nicht möglich. Diese Art Code muss sauber getrennt ausgelagert werden, z.B. als Plugin Ein Beispiel was in diese Richtung geht findet ihr hier [http://wiki.shopware.com/\_detail\_1700.html](http://wiki.shopware.com/%5C_detail%5C_1700.html) Sebastian

---

<div class="post-metadata">

**Author:** ![Benji89](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@Benji89](https://forum.shopware.com/u/Benji89)\
**Post date:** [27. November 2014 um 21:51 UTC](https://forum.shopware.com/t/trusted-shop-bewertungen-als-rich-snippet-in-footer-tpl/23558/4 "2014-11-27T21:51:57Z")

</div>

So hab es mit hilfe eines Freund hinbekommen!! 😃 1. Anpassung footer.tpl: /templates/emotion\_XXmeinTPLXX/frontend/index/footer.tpl neu ist die Zeile :

{get\_trustedshopmodule tsid=xxxxxxxxx}

[code]  
{block name=‚frontend\_index\_footer\_menu‘} {include file=‚frontend/index/menu\_footer.tpl‘}

{/block}  
{block name=‚frontend\_index\_footer\_copyright‘}  
{block name=‚frontend\_index\_footer\_vatinfo‘}  
{if $sOutputNet}

{s name=‚FooterInfoExcludeVat‘}&nbsp;{/s}

{else}

{s name=‚FooterInfoIncludeVat‘}&nbsp;{/s}

{/if}  
{/block}

{s name=„IndexCopyright“}Copyright © 2014 shopware AG{/s}{include file=‚frontend/\_resources/\_ts\_template/tsc/tsc.tpl‘}

{get\_trustedshopmodule tsid=xxx}

{/block} [/code] 2. Neue Datei anlegen: /engine/Library/Smarty/plugins/function.get\_trustedshopmodule.php [code]\<?php /\*

- Smarty plugin
- 
* * *
- File: function.get\_trustedshopmodule.php
- Type: function
- Name: get\_trustedshopmodule
- Purpose: gets the trusted shop module
- 
* * *

\*/  
function smarty\_function\_get\_trustedshopmodule($params, $smarty)  
{  
$tsId = $params[‚tsid‘];  
$output = „“;

```
if ($xml = simplexml_load_file("https://www.trustedshops.com/bewertung/show_xml.php?tsid=".$tsId)) {
	$result = $xml->ratings-\>result[1]; $max = "5.00"; $count = $xml-\>ratings["amount"]; $shopName = $xml-\>name; $output = " [Kundenbewertungen von Trusted Shops](\"http://www.trustedshops.de/shop-info/trusted-shops-kundenbewertungen/\"): $result / $max bei $count [$shopName Bewertungen](\"https://www.trustedshops.de/bewertung/info_$tsId.html\")"; } return $output; } ?\> [/code]
```
