Override Engine and OpenCart

In OpenCart (since ??)  the Twig was moved to another location, and, OverrideEngine stopped working. Unfortunately, there is no any newer version from author.

Find the code (line 792, version for OpenCart

include_once(DIR_SYSTEM . 'library/template/Twig/Autoloader.php');
$loader = new \Twig_Loader_Filesystem(DIR_TEMPLATE);		
$config = array('autoescape' => false, 'cache'=>false);

and replace with:

$loader = new \Twig\Loader\FilesystemLoader();
$config = array( 'autoescape'  => false, 'cache'	=> false, 'debug' => false, 'auto_reload' => true );

Leave a Reply

Your email address will not be published. Required fields are marked *