public function install() {
$this->subscribeEvent(
'Enlight_Controller_Action_PostDispatchSecure_Frontend',
'onFrontendPostDispatch',
0
);
return array('success' => true, 'invalidateCache' => array('frontend'));
}
public function onFrontendPostDispatch(\Enlight_Event_EventArgs $args)
{
/** @var \Enlight_Controller_Action $controller */
$controller = $args->get('subject');
$view = $controller->View();
$view->addTemplateDir(
__DIR__ . '/Views'
);
}
I had tried to run the plugin and override Template but Shopware does not see changes in a plugin.
I am creating new file in /Views/frontend/checkout/cart_footer.tpl
in plugins root.
I am also insert
{extends file='parent:frontend/checkout/cart_footer.tpl'}
line in .tpl file but still no success.
Does any one know where is a problem?
This was very easy
I just add one line
And change code little bit.
I am change event from
Enlight_Controller_Action_PostDispatchSecure_Frontend
toEnlight_Controller_Action_PostDispatch_Frontend_Checkout
and add
$view->loadTemplate('frontend/plugins/checkout/cart.tpl');
This path is related from"/Views"
folder which is declared inaddTemplateDir
method.Bellow is whole code, Enjoy :)