Skip to content

Instantly share code, notes, and snippets.

@KristianH
Created January 4, 2018 15:34
Show Gist options
  • Save KristianH/8190345bc4b228f09683f6435de721be to your computer and use it in GitHub Desktop.
Save KristianH/8190345bc4b228f09683f6435de721be to your computer and use it in GitHub Desktop.
Override oxid eshop standard smarty plugins
<?php
use OxidEsales\Eshop\Core\Registry;
// fill d3/modulename/Core/Smarty/Plugin/ with plugins like function.oxprice.php, function.oxcontent.php etc.
class d3_oxutilsview_modulename extends d3_oxutilsview_modulename_parent
{
/**
* @param Smarty $oSmarty
*
* @return null|void
* @throws \OxidEsales\EshopCommunity\Core\oxFileException
*/
protected function _fillCommonSmartyProperties($oSmarty)
{
parent::_fillCommonSmartyProperties($oSmarty);
// add before current plugins directory:
array_unshift(
$oSmarty->plugins_dir,
Registry::getConfig()->getActiveView()->getViewConfig()->getModulePath('modulename')
. 'Core/Smarty/Plugin'
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment