# Override theme TPL file from custom plugin

**URL:** https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755
**Category:** International (English Only)
**Tags:** general
**Created:** [31. Juli 2019 um 07:49 UTC](https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755 "2019-07-31T07:49:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![roberto](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@roberto](https://forum.shopware.com/u/roberto)
#### Post date: [31. Juli 2019 um 07:49 UTC](https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755/1 "2019-07-31T07:49:14Z")

</div>

Hi all,

I’ve created a plugin that should replace one of the theme TPLs with its own one. **I’m trying to extend the content from change\_payment.tpl inside checkout from my plugin** , I have used this guide [Example plugin: storefront extension](https://developers.shopware.com/developers-guide/example-plugin/) to register my templates folder creating the service and the TemplateRegistration.php file. Also checked and **$injectBeforePlugins is set to true** in the Theme.php file but still can’t see the code.

Cleared the cache hundred million times and still nothing. Everything seems to be as it should but can’t get the template overwritten.

&nbsp;

**change\_payment.tpl** inside custom/plugins/MYPLUGIN/Resources/views/frontend/checkout

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

{block name='frontend_checkout_payment_fieldset_description'}
    
        {include file="string:{$payment_mean.additionaldescription}"}
        
        {if $payment_mean.isPurchasePaymentOption}
            {s namespace="frontend/payment_purchase_order_option/main" name="reference_number"}Referece number{/s}
            
        {/if}
    
{/block}

```

Part of my **services.xml** for the TemplateRegistration subscriber

```
            %ixis_purchase_order_option.plugin_dir%

```

&nbsp;

The **TemplateRegistration.php** file

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

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

    /**
     * Registers the template directory globally for each request
     */
    public function onPreDispatch()
    {
        $this->templateManager->addTemplateDir($this->pluginPath . '/Resources/views/');
    }
}

```

&nbsp;

Will appreciate any help!

---

<div class="post-metadata">

### Author: ![shopnoob85](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@shopnoob85](https://forum.shopware.com/u/shopnoob85)
#### Post date: [14. August 2019 um 16:01 UTC](https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755/2 "2019-08-14T16:01:56Z")

</div>

Same problem here. I’am not able to overwrite any block on any template and i dont know why.&nbsp;

But you know what, SwagSloganOfTheDay or SwasShoeSize will not work, too.

So currentyl iam angry because i dont know why. So please Shopware help us.

By the way a use a local shopware installation via xampp

---

<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: [14. August 2019 um 16:38 UTC](https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755/3 "2019-08-14T16:38:34Z")

</div>

The template inheritance has some issues on windows. Without a proper linux based development environment, you won‘t get it working properly.

---

<div class="post-metadata">

### Author: ![shopnoob85](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@shopnoob85](https://forum.shopware.com/u/shopnoob85)
#### Post date: [15. August 2019 um 12:18 UTC](https://forum.shopware.com/t/override-theme-tpl-file-from-custom-plugin/60755/4 "2019-08-15T12:18:37Z")

</div>

Ok, thanks for the information but how can i run a local shopware shop under windows without issues with the template inheritance? Is there a way or do i need to install shopware via vm or docker or should i install a linux on my pc?
