Theme : Journal 3
Opencart : 3.0.4.0
Normally I was always using 3.0.3.2. There was no problem.
I decided to try opencart 3.0.4.0 on my test domain by installing everything from scratch. Everything is working stably, I'm having problems with only 2 plugins. I tried all php versions and it didn't work.
Code: Select all
$file = modification( DIR_TEMPLATE . $filename . ‘.twig’ );
I tried this did not work.
There is no problem with the plugin's files, I checked how many times.
This is the error, but I can't see any details, so I can't figure out what exactly is causing it.
Notice: Error: Could not load template extension/shipping/xshippingpro! in /home/demo/domains/democom/public_html/v1/system/system/storage/modification/system/library/template/twig.php on line 58
Notice: Error: Could not load template extension/module/promotionModule/promotion_stats! in /home/demo/domains/demo.com/public_html/v1/system/system/storage/modification/system/library/template/twig.php on line 58
These are the line 58 codes where the error appears
Code: Select all
trigger_error('Error: Could not load template ' . $filename . '!');
/system/library/template/twig.php //file content
Code: Select all
<?php
namespace Template;
final class Twig {
private $data = array();
public function set($key, $value) {
$this->data[$key] = $value;
}
public function render($filename, $code = '') {
if (!$code) {
$file = DIR_TEMPLATE . $filename . '.twig';
if (defined('DIR_CATALOG') && is_file(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig');
} elseif (is_file(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig');
} elseif (is_file($file)) {
$code = file_get_contents($file);
} else {
throw new \Exception('Error: Could not load template ' . $file . '!');
exit();
}
}
// initialize Twig environment
$config = array(
'autoescape' => false,
'debug' => false,
'auto_reload' => true,
'cache' => DIR_CACHE . 'template/'
);
try {
$loader = new \Twig\Loader\ArrayLoader(array($filename . '.twig' => $code));
// Journal Theme Modification
if (defined('JOURNAL3_ACTIVE')) {
$j3loader = new \Twig\Loader\FilesystemLoader([], '');
if (defined('DIR_CATALOG') && is_dir(DIR_MODIFICATION . 'admin/view/template/')) {
$j3loader->addPath(DIR_MODIFICATION . 'admin/view/template/');
} elseif (is_dir(DIR_MODIFICATION . 'catalog/view/theme/')) {
$j3loader->addPath(DIR_MODIFICATION . 'catalog/view/theme/');
}
$j3loader->addPath(DIR_TEMPLATE);
$loader = new \Twig\Loader\ChainLoader(array($loader, $j3loader));
}
// End Journal Theme Modification
$twig = new \Twig\Environment($loader, $config);
return $twig->render($filename . '.twig', $this->data);
} catch (\Exception $e) {
trigger_error('Error: Could not load template ' . $filename . '!');
exit();
}
}
}