# PHP / SMARTY / SHOPWARE - EINBINDUNG EINES PHP-SCRIPTES

**URL:** <https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [22. Juli 2012 um 23:02 UTC](https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800 "2012-07-22T23:02:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![istore24](https://avatars.discourse-cdn.com/v4/letter/i/a6a055/32.png) [@istore24](https://forum.shopware.com/u/istore24)\
**Post date:** [22. Juli 2012 um 23:02 UTC](https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800/1 "2012-07-22T23:02:57Z")

</div>

Sehr geehrte Forum-Mitglieder, ich versuche folgende Spript per PHP in Shopware einzubinden. Folgende Versuch habe ich gestartet. FOOTER.TPL ------------------------- {php} {include\_php file="/pfad/tsgoogle.php"} {/php} TSGOOGLE.PHP-Datei -------------------------\<?php $tsId = “XXXXXXXXXXXXXXXXXXX”;  
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”];?\> [Kundenbewertungen von Trusted Shops](http://www.trustedshops.de/shop-info/trusted-shops-kundenbewertungen/): =$result;?\> / =$max;?\> bei =$count;?\> [Bewertungen](https://www.trustedshops.de/bewertung/info_%3C?=%24tsId?%3E.html)\<?php }?\>------------------------- Leider bekomme ich eine Fehlermeldung und das Template läßt sich garnicht mehr richtig starten. Ich bitte um Hilfe??? mfg

---

<div class="post-metadata">

**Author:** ![Linda](https://avatars.discourse-cdn.com/v4/letter/l/67e7ee/32.png) [@Linda](https://forum.shopware.com/u/Linda)\
**Post date:** [23. Juli 2012 um 08:19 UTC](https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800/2 "2012-07-23T08:19:01Z")

</div>

Versuche mal anstatt \<?php und ?\> auch in der PHP-Datei dies: {php} {/php} So hatte es bei mir funktioniert 🙂

---

<div class="post-metadata">

**Author:** ![istore24](https://avatars.discourse-cdn.com/v4/letter/i/a6a055/32.png) [@istore24](https://forum.shopware.com/u/istore24)\
**Post date:** [23. Juli 2012 um 09:00 UTC](https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800/3 "2012-07-23T09:00:05Z")

</div>

Hallo danke für den Tipp. Geht leider trotz Änderung immer noch nicht. Folgender Fehler wird ausgegeben. Fehler: Fatal error: Uncaught exception ‘SmartyCompilerException’ with message ‘Syntax Error in template “/istspdrj/www.istore24-shop.de/shop/templates/istore24/frontend/index/footer.tpl” on line 4 “{/php}” include\_php: file ““[www.istore24-shop.de/shop/tsgoogle.php](http://www.istore24-shop.de/shop/tsgoogle.php)”” is not readable’ in /istspdrj/www.istore24-shop.de/shop/engine/Enlight/Vendor/Smarty/libs/sysplugins/smarty\_internal\_templatecompilerbase.php:404 Stack trace: #0 /istspdrj/www.istore24-shop.de/shop/engine/Enlight/Vendor/Smarty/libs/sysplugins/smarty\_internal\_compile\_include\_php.php(44): Smarty\_Internal\_TemplateCompilerBase-\>trigger\_template\_error(‘include\_php: fi…’) #1 /istspdrj/www.istore24-shop.de/shop/engine/Enlight/Vendor/Smarty/libs/sysplugins/smarty\_internal\_templatecompilerbase.php(252): Smarty\_Internal\_Compile\_Include\_Php-\>compile(Array, Object(Smarty\_Internal\_SmartyTemplateCompiler), NULL, NULL, NULL) #2 /istspdrj/www.istore24-shop.de/shop/engine/Enlight/Vendor/Smarty/libs/sysplugins/smarty\_internal\_templatecompilerbase.php(114): Smarty\_Internal\_TemplateC in /istspdrj/www.istore24-shop.de/shop/engine/Enlight/Vendor/Smarty/libs/sysplugins/smarty\_internal\_templatecompilerbase.php on line 404 mfg

---

<div class="post-metadata">

**Author:** ![Linda](https://avatars.discourse-cdn.com/v4/letter/l/67e7ee/32.png) [@Linda](https://forum.shopware.com/u/Linda)\
**Post date:** [23. Juli 2012 um 09:13 UTC](https://forum.shopware.com/t/php-smarty-shopware-einbindung-eines-php-scriptes/7800/4 "2012-07-23T09:13:01Z")

</div>

Lass mal in der footer.tpl das {php} und {/php} weg 🙂 und den include so: {include file=‘PFAD’}
