Disable template caching for development in OpenCart 3

后端 未结 8 531
我寻月下人不归
我寻月下人不归 2020-12-02 01:41

I am making changes in my theme templates in OpenCart 3. Due to template caching I have to clear cache every time under \"storage/cache\" directory. It is very annoying when

相关标签:
8条回答
  • 2020-12-02 02:03

    Opencart Version 3.0.2.0 I was having same problem, try working in theme editor or the actual raw twig file, after an hour or two i tried this it worked.

    Delete the changes in theme editor and got back editing actual twig file my screen shot

    0 讨论(0)
  • 2020-12-02 02:04

    This is similar to Scott's answer but just on the database/backend. In case you can't rely on the UI and can only access the DB (like me, I'm messing up with the UI) it's on settings table search for 'developer_theme' key and set it to false or 0.

    UPDATE `oc_setting` SET `value` = '0' WHERE `oc_setting`.`key` = 'developer_theme';
    
    0 讨论(0)
  • 2020-12-02 02:05

    You might need to upgrade to a more recent version of OpenCart3 - the first one (3.0.0.0) didn't have a way of doing this in the GUI.

    More recent versions, such as 3.0.2.0, have a gear on the admin dashboard. Click the gear and you get options to disable caching.

    0 讨论(0)
  • 2020-12-02 02:12

    Scott's answer is best but in case it's not available due to version or you want to disable it programmatically you can do this anywhere before the twig is rendered:

    $this->config->set('template_cache', false);
    
    0 讨论(0)
  • 2020-12-02 02:14

    I think you edit the template as the path: Design->Theme Editor before.

    Clear all of the date in the oc_theme data table of your database.

    0 讨论(0)
  • 2020-12-02 02:14

    in OC 3.0.3.6, if you have some twig extension, like twig managers, after changes maded you should select that extention in modifications and refresh push button on top right corner.

    P.S. loose whole day to find this, hope it helps someone

    0 讨论(0)
提交回复
热议问题