简体   繁体   English

在打开的购物车中显示消息 Twig_Error_Loader

[英]Showing message Twig_Error_Loader in open cart

I am using open cart version 3. And I got the following message: Twig_Error_Loader in open cart after replacing theme files.我正在使用开放式购物车版本 3。我收到以下消息:替换主题文件后打开购物车中的Twig_Error_Loader

Full error:完整错误:

 Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to 
find template "common/column_left.twig" (looked into: 
C:/xampp/htdocs/fast/catalog/view/theme).' in 
C:\xampp\htdocs\fast\system\library\template\Twig\Loader\Filesystem.php:215 
Stack trace: #0  
 C:\xampp\htdocs\fast\system\library\template\Twig\Loader\Filesystem.php(139 
Twig_Loader_Filesystem->findTemplate('common/column_l...') #1 
C:\xampp\htdocs\fast\system\library\template\Twig\Environment.php(312): 
Twig_Loader_Filesystem->getCacheKey('common/column_l...') #2 
C:\xampp\htdocs\fast\system\library\template\Twig\Environment.php(378): 
Twig_Environment->getTemplateClass('common/column_l...', NULL) #3 
C:\xampp\htdocs\fast\system\library\template\twig.php(52): Twig_Environment-
>loadTemplate('common/column_l...') #4 
C:\xampp\htdocs\fast\system\library\template.php(22): Template\Twig-
>render('common/column_l...', false, 'fastor') #5 
C:\xampp\htdocs\fast\system\engine\loader.php(86): Template-
>render('common/column_l...', Object(Registry), '1') #6 C:\xampp\ in 
C:\xampp\htdocs\fast\system\library\template\Twig\Loader\Filesystem.php on 
line 215

Your help will be greatly appreciated对你的帮助表示感谢

it looks that the problem resides in catalog/controller/event/theme.php 看来问题出在目录/控制器/事件/theme.php

the Code assigns a path only when $theme:info isn't set. 仅当未设置$ theme:info时,该代码才分配路径。

    if ($theme_info) {
        $template = html_entity_decode($theme_info['code'], ENT_QUOTES, 'UTF-8');
    }elseif (is_file(DIR_TEMPLATE . $theme . '/template/' . $route . '.twig')) {
        $this->config->set('template_directory', $theme . '/template/');
    } elseif (is_file(DIR_TEMPLATE . 'default/template/' . $route . '.twig')) {
        $this->config->set('template_directory', 'default/template/');
    }

I modified the code to this. 我对此进行了修改。 Now a path is asigned and the whole thing works. 现在分配了一条路径,整个过程正常进行。 You still have to reload the cache to see modification. 您仍然必须重新加载缓存才能看到修改。

if ($theme_info) {
        $template = html_entity_decode($theme_info['code'], ENT_QUOTES, 'UTF-8');
    } 
    if (is_file(DIR_TEMPLATE . $theme . '/template/' . $route . '.twig')) {
        $this->config->set('template_directory', $theme . '/template/');
    } elseif (is_file(DIR_TEMPLATE . 'default/template/' . $route . '.twig')) {
        $this->config->set('template_directory', 'default/template/');
    }

Solved in the following way.通过以下方式解决。 In the admin panel, go to Design-> template editor, on the right "History" Find and delete common/column_left.在admin面板,go到Design->template editor,在右边的“History”中找到common/column_left并删除。 The left column will be rolled back "by default" If you need to make changes to it, do it in the column_left.twig file and upload it to the server, update the cache.左侧列将“默认”回滚 如果您需要对其进行更改,请在 column_left.twig 文件中进行,并将其上传到服务器,更新缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM