How does the Opencart system/modifications folder function?

穿精又带淫゛_ 提交于 2019-12-06 00:47:57

You can say that ocmod is same as vqmod but it differs in some ways and provided by default in opencart 2.0 and above version. You have to reset modification cache every time you make any changes to your module to see its effect. Like vqmod ocmod also generates cache files which are placed in modification folder. And files in this folder will get prior then the original one. As i think you were modifying files in modification file you might lose them if you clear modification cache from admin panel.

You can check system/startup.php file for more understanding.

// Modification Override
function modification($filename) {
if (!defined('DIR_CATALOG')) {
    $file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(DIR_APPLICATION));
} else {
    $file = DIR_MODIFICATION . 'admin/' .  substr($filename, strlen(DIR_APPLICATION));
}

if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
    $file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM));
}

if (is_file($file)) {
    return $file;
}

return $filename;
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!