COLORADO: 11:54 pm
JAPAN: 2:54 pm

-1308 days for S+Y!



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: OPEN CART 3 search gives server error 500
PostPosted: Sat Jun 23, 2018 11:35 pm 
SysOp
User avatar

Joined: Sun Nov 08, 2009 7:03 pm
Posts: 1562
Location: Colorado
Important fix!!!!


https://stackoverflow.com/questions/473 ... -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.

Code:
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



it looks that the problem resides in catalog/controller/event/theme.php

the Code assigns a path only when $theme:info isn't set.

Code:
 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.

Code:
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/');
    }


answered Jan 24 at 13:41
Martin S.

_________________
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

Bookmark and Share



Top
 OfflineProfile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 2 guests



Search for:
cron

This site contains adult natured content. All material submitted to this site is the sole responsibility of the submitter.

© 2023 Iron Feather Journal

 

Recent Visitors: