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!