0

I am new to opencart. So the case is I was trying to change the layout of the side menu. So I went to theme editor of opencart admin backend and edit the header.twig file. Then my site immediately went down. I tried reset the file but no help. Below are some details.

  • Opencart version: 3.0.2.0
  • Template used: Not default template(It is Laparis: Demo 7)
  • File edited: header.twig(Already reset but no help)
  • Error message from log:

    [28-Sep-2017 02:32:46 UTC] PHP Fatal error:  Uncaught exception 
    'Twig_Error_Syntax' with message 'Unknown "str_replace" function in "__string_template__85be79fc1c90839e75914d8e962e8d511d190b089fb189c9253a6adf4e71ae9f" at line 16.' in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php:574
    Stack trace:
    #0 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('str_replace', 16)
    #1 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('str_replace', 16)
    #2 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
    #3 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
    #4 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(91): Twig_ExpressionParser->parseExpression()
    #5 /home/gloo/public_html/newgloo/system/lib in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php on line 574
    
  • Another error log from ocartdata/storage/logs:

    PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/gloo/public_html/newgloo/admin/model/bossthemes/boss_newmegamenu.php:1) in /home/gloo/public_html/newgloo/system/library/response.php on line 36
    

I thought it might be the cache issue, so I cleared all cache. But still no luck.

Please tell me what can I do to make my site up again. Any help on this is much appreciated. Thanks.

Kent Chin
  • 47
  • 10
  • The filter/function `str_replace` does not exists inside `twig` by default. It's called `replace` e.g. `{{ foo | replace({ 'bar' : 'foo', }) }}` – DarkBee Sep 28 '17 at 05:28
  • have you refresh developer cache? if not. So, please refresh developer cache & then check it. please see here for more details refresh cache- https://stackoverflow.com/questions/45220327/disable-template-caching-for-development-in-opencart-3 – HDP Sep 29 '17 at 11:37

0 Answers0