Override theme TPL file from custom plugin

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 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.

 

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%

 

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/');
    }
}

 

Will appreciate any help!

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

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

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

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?