# Plugin statt custom Theme anzeigen

**URL:** https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450
**Category:** Plugins
**Created:** [13. Juni 2018 um 07:41 UTC](https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450 "2018-06-13T07:41:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MHotait](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MHotait](https://forum.shopware.com/u/MHotait)
#### Post date: [13. Juni 2018 um 07:41 UTC](https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450/1 "2018-06-13T07:41:35Z")

</div>

Hallo,

ich habe eine Problem und zwar ich habe eine Plugin geschrieben aber die tpl in die plugin ist nicht&nbsp;anerkannt und statt diese ist nur die tpl von die custom theme angezeigt. was soll ich machen damit die tpl von die plugin angezeigt ist. Ich glaube nicht das der structur und der code von plugin hat ein fehler weil das ist ein einfaches plugin.

&nbsp;

MohtGeschenkVerpackung.php

```
scheduleClearCache($this->getCacheArray());
        parent::install($context);
 
    }
 
    public function uninstall(UninstallContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::uninstall($context);
    }
 
    public function activate(ActivateContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::install($context);
    }
 
    public function deactivate(DeactivateContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::install($context);
    }
 
 
    /**
     * Get caches to clear
     *
     * @return array
     */
    private function getCacheArray()
    {
        return [
            InstallContext::CACHE_TAG_CONFIG,
            InstallContext::CACHE_TAG_HTTP
        ];
    }
}

```

Subscriber/TemplateRegistration.php

```
pluginDirectory = $pluginDirectory;
        $this->templateManager = $templateManager;
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents()
    {
        return [
            'Enlight_Controller_Action_PreDispatch' => 'onPreDispatch'
        ];
    }

    public function onPreDispatch()
    {
        $this->templateManager->addTemplateDir($this->pluginDirectory . '/Resources/views');
    }
}

```

und Resources/service.xml

```
            %moht_geschenk_verpackung.plugin_dir%

```

die template habe ich unter Resources/views/checkout/cart\_footer.tpl

```
{extends file="parent:frontend/checkout/cart_footer.tpl"}

{* Add product using the sku *}
{block name='frontend_checkout_cart_footer_add_product'}
    aaaaaaaaa
{/block}

{block name='frontend_checkout_cart_footer_element'}
    vvvvv
{/block}

```

&nbsp;

---

<div class="post-metadata">

### Author: ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)
#### Post date: [13. Juni 2018 um 07:49 UTC](https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450/2 "2018-06-13T07:49:34Z")

</div>

Schau dir mal die Template-Verbung an:&nbsp;[Getting started with Smarty](https://developers.shopware.com/designers-guide/smarty/#template-inheritance)  
Wenn das Theme “injectbeforeplugins = false” hat, dann kannst du es nicht mit einem Plugin überschreiben.

---

<div class="post-metadata">

### Author: ![MHotait](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MHotait](https://forum.shopware.com/u/MHotait)
#### Post date: [13. Juni 2018 um 08:06 UTC](https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450/3 "2018-06-13T08:06:17Z")

</div>

danke für Ihre Hilfe aber&nbsp;injectbeforeplugins ist bei mir = true also in die theme.php von Bare und meine Theme auch. Was kann noch die problem sein ? also die plugin structur ist wie oben in die code geschrieben also ich denke damit habe ich kein problem oder ?&nbsp;

---

<div class="post-metadata">

### Author: ![MHotait](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MHotait](https://forum.shopware.com/u/MHotait)
#### Post date: [13. Juni 2018 um 08:30 UTC](https://forum.shopware.com/t/plugin-statt-custom-theme-anzeigen/53450/4 "2018-06-13T08:30:21Z")

</div>

> **[Datei-Upload, Freigabe und Cloud-Backup-Service.](https://de.files.fm/u/aj7vrx7b)**
>
> Visit this link to download: 2018-06-13\_aj7vrx7b

hier ist die zip datei. Danke im voraus
