Hallo liebe Community, Ich tue mich ein wenig schwer mein erstes Plugin zu schreiben. Der Warenkorbtext ändert sich einfach nicht, wenn ich das über das Plugin versuche. Füge ich die buy.tpl zu meinem Template hinzu, funktioniert es einwandfrei. Also muss der Fehler irgendwo in meiner Boostrap stecken… Ich habs schon mit Enlight_Controller_Action_PostDispatch_Frontend_Detail und Enlight_Controller_Action_PreDispatch_Frontend_Detail versucht… Was mache ich falsch? Meine Bootstrap Datei: [code]<?php class Shopware_Plugins_Frontend_MyFirstPlugin_Bootstrap
extends Shopware_Components_Plugin_Bootstrap
{
public function getCapabilities()
{
return array(
'install' => true, 'update' =\> true, 'enable' =\> true ); } public function getLabel() { return 'Warenkorbbuttontext ändern'; } public function getVersion() { return '1.0.0'; } public function getInfo() { return array( 'version' =\> $this-\>getVersion(), 'label' =\> $this-\>getLabel(), 'autor' =\> 'me', 'supplier' =\> 'me', 'source' =\> "Local", 'description' =\> 'Warenkorbbuttontext ändern', 'support' =\> 'support@me.de', 'link' =\> 'http://www.me.de', 'copyright' =\> 'Copyright © 2014' ); } public function install() { $this-\>registerEvents(); return array('success' =\> true, 'invalidateCache' =\> array('frontend')); } public function uninstall() { return array('success' =\> true, 'invalidateCache' =\> array('frontend')); } private function registerEvents() { $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PreDispatch\_Frontend\_Detail', 'onPreDispatchFrontendDetail' ); } public function onPreDispatchFrontendDetail(Enlight\_Event\_EventArgs $arguments) { /\*\*@var $controller Shopware\_Controllers\_Frontend\_Index\*/ $controller = $arguments-\>getSubject(); /\*\* \* @var $request Zend\_Controller\_Request\_Http \*/ $request = $controller-\>Request(); /\*\* \* @var $response Zend\_Controller\_Response\_Http \*/ $response = $controller-\>Response(); /\*\* \* @var $view Enlight\_View\_Default \*/ $view = $controller-\>View(); //Check if there is a template and if an exception has occured if(!$request-\>isDispatched()||$response-\>isException()||!$view-\>hasTemplate()) { return; } //Add our plugin template directory to load our slogan extension. $view-\>addTemplateDir($this-\>Path() . 'Views/'); $view-\>extendsTemplate('frontend/detail/buy.tpl'); } } [/code] [u] [b]Meine buy.tpl:[/b][/u] [code] {block name='frontend\_detail\_buy\_button'} {if $sArticle.attr4}<input type="submit" id="basketButton" class="transparent" disabled name="Myowntext" myowntext value="{s name=" style="{$buy_box_display}">{else}<input type="submit" id="basketButton" class="transparent" disabled name="DetailBuyActionAdd" detailbuyactionadd value="{s name=" style="{$buy_box_display}">{/if} {/block} [/code] [u][b]Plugin abgelegt in:[/b][/u] Plugins =\> Local =\> Frontend [u][b]Meine Ordnerstruktur:[/b][/u] MyFirstPlugin -\> Bootstrap.php MyFirstPlugin -\> Views -\> frontend -\> detail -\> buy.tpl Shopware Version 4.2.1