Hallo zusammen, ich bin neu in der Shopware-Welt und beiße mir seit Tagen die Zähne an einem mir unerklärlichen Problem aus. Ich habe angefangen mein erstes Plugin zu erstellen. Ich bekomme es aber einfach nicht zum laufen. Laut der Shopware-Doku mache ich alles richtig, aber leider funktioniert es nicht. Die Hooks scheinen schon zu greifen, aber das Laden der Template-Datei schlägt dann irgendwie fehl. Zeile 56 der Boostrap.php scheint das Problem auszulösen. Der Fehler beschreibt sich wie folgt: [quote]Unable to load template snippet ‘frontend/detail/index.tpl|frontend/plugins/prices_by_size/index.tpl|frontend/plugins/compare/index.tpl|frontend/plugins/seo/index.tpl’ in Smarty/sysplugins/smarty_internal_templatebase.php on line 127 Stack trace: #0 Enlight/View/Default.php(273): Smarty_Internal_TemplateBase->fetch() #1 Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(212): Enlight_View_Default->render(Object(Enlight_Template_Default)) #2 Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(238): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->renderTemplate(Object(Enlight_Template_Default)) #3 Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(136): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->render() #4 [internal function]: Enlight_Controller_Plugins_ViewRenderer_Bootstrap->onPostDispatch(Object(Enlight_Event_EventArgs)) #5 Enlight/Event/Handler/Default.php(91): call_user_func(Array, Object(Enlight_Event_EventArgs)) #6 Enlight/Event/EventManager.php(165): Enlight_Event_Handler_Default->execute(Object(Enlight_Event_EventArgs)) #7 Enlight/Controller/Action.php(191): Enlight_Event_EventManager->notify(‘Enlight_Control…’, Array) #8 Enlight/Controller/Dispatcher/Default.php(521): Enlight_Controller_Action->dispatch(‘indexAction’) #9 Enlight/Controller/Front.php(214): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #10 Shopware/Components/HttpCache/HttpKernel.php(79): Enlight_Controller_Front->dispatch() #11 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(434): Shopware\Components\HttpCache\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 Shopware/Components/HttpCache/AppCache.php(234): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #13 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(403): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #14 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(303): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(Object(Symfony\Component\HttpFoundation\Request), true) #15 Shopware/Components/HttpCache/AppCache.php(158): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true) #16 Symfony/Component/HttpKernel/HttpCache/HttpCache.php(192): Shopware\Components\HttpCache\AppCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true) #17 Shopware/Components/HttpCache/AppCache.php(110): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 Shopware/Bootstrap.php(70): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #19 Enlight/Application.php(192): Shopware_Bootstrap->run() #20 shopware.php(83): Enlight_Application->run() #21 {main}[/quote] Die beiden Dateien (das Plugin besteht momentan nicht aus mehr), habe ich angehängt. Kann mir jemand sagen, ob ich etwas falsch mache? Ich flippe aus. Greetz und Danke, Alex – index.tpl {block name=frontend\_detail\_buy\_quantity prepend}<label for>Länge:</label><input type="text" id="length" name="length">{/block} {block name=frontend\_checkout\_cart\_item\_details\_inline} Länge: {$sBasketItem.ob\_attr1} mm {/block}
Bootstrap.php [code]<?php class Shopware_Plugins_Frontend_PricesBySize_Bootstrap extends Shopware_Components_Plugin_Bootstrap {
public function getCapabilities() {
return array(
'install' => true, 'update' =\> true, 'enable' =\> true ); } public function getLabel() { return 'Preis nach Maß'; } public function getVersion() { return '1.0.0'; } public function getInfo() { return array( 'version' =\> $this-\>getVersion(), 'label' =\> $this-\>getLabel(), 'supplier' =\> 'Alex Bartsch', 'description' =\> 'Preis abhängig von Eingabe des Benutzers', 'support' =\> 'Alex Bartsch', 'link' =\> 'http://www.alexbartsch.de' ); } public function install() { $event = $this-\>createEvent( 'Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Detail', 'onPostDispatchFrontendDetail' ); $this-\>subscribeEvent($event); return true; } public function onPostDispatchFrontendDetail(Enlight\_Event\_EventArgs $arguments) { $controller = $arguments-\>getSubject(); $request = $controller-\>Request(); $response = $controller-\>Response(); $view = $controller-\>View(); if(!$request-\>isDispatched() || $response-\>isException() || $request-\>getModuleName() != 'frontend' || $request-\>getControllerName() != 'detail' || !$view-\>hasTemplate()) { return; } $view-\>addTemplateDir($this-\>Path() . 'Views/'); $view-\>extendsTemplate('frontend/plugins/prices\_by\_size/index.tpl'); } }[/code]