Comments (4)
Did you find a solution?
Nothing wrong with vqMod or ocMod
I believe it's another step to block any changes/modifications of the greatest OpenCart code.
The problem with /system/library/template/twig.php file
modification.xml does not work and DOES NOT help
The system renders template only from original directories ONLY, I hope I am right
Try to replace the content of this file with the code below, I's helped me
<?php
namespace Template;
final class Twig {
private $data = array();
public function set($key, $value) {
$this->data[$key] = $value;
}
public function render($template, $cache = false) {
$loader = new \Twig\Loader\FilesystemLoader();
// specify where to look for templates
if (defined('DIR_CATALOG') && is_dir(DIR_MODIFICATION . 'admin/view/template/')) {
$loader->addPath(DIR_MODIFICATION . 'admin/view/template/');
} elseif (is_dir(DIR_MODIFICATION . 'catalog/view/theme/')) {
$loader->addPath(DIR_MODIFICATION . 'catalog/view/theme/');
}
$loader->addPath(DIR_TEMPLATE);
// initialize Twig environment
$config = array(
'autoescape' => false,
'debug' => false,
'auto_reload' => true,
'cache' => false
);
if ($cache) {
$config['cache'] = DIR_CACHE . 'template/';
}
// echo ($cache? 'true': 'false'), ' --- '; print_r($config);
$this->twig = new \Twig\Environment($loader, $config);
try {
// load template
$template = $this->twig->loadTemplate($template . '.twig');
return $template->render($this->data);
} catch (Exception $e) {
trigger_error('Error: Could not load template ' . $template . '!');
exit();
}
}
}
from vqmod.
I don't use VQMOD. It was just a suggestion for developer to add compatibility.
from vqmod.
up
from vqmod.
Too add compatibility you can install this extension.
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=39911
Alternativly add this code in vqmod_opencart.xml
<file path="system/library/template/twig.php" error="skip" info="fix Core Opencart twig files modification">
<operation>
<search><![CDATA[$file = DIR_TEMPLATE . $filename . '.twig';]]></search>
<add position="replace"><![CDATA[$file = modification( DIR_TEMPLATE . $filename . '.twig' );
if( class_exists('VQMod') ) {
$file = \VQMod::modCheck($file);
}
]]></add>
</operation>
</file>
A implemented fix for this would be nice.
from vqmod.
Related Issues (20)
- Wiki issues HOT 2
- Using Vqmod in new symfony project HOT 1
- Opencart Vq Mode Checked.cache file - definitely solved HOT 1
- checked.cache stores already stored data HOT 1
- checked.cache causing slow load times HOT 1
- Will there be an update for OC4? HOT 7
- Out of memory error HOT 1
- Undefined method error HOT 1
- changes to Journal checkout elements not used HOT 1
- vqmod/install missing index.php HOT 2
- Only search for specific word HOT 9
- Deprecated: Use of "self" in callables is deprecated HOT 9
- HTTP 500 HOT 3
- Install problems (File manager opens instead of install script) HOT 2
- VQMod fails to apply modifications to the twig files included from other twig templates files. HOT 2
- php 8.2 > Deprecated HOT 1
- installing vQmod instructions not working HOT 1
- unexpected result HOT 1
- v2.6.6 OpenCart issue (Use of "self" in callables is deprecated) HOT 4
- When storage folder is moved from /system/storage error occur HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vqmod.