无需接触Core和VQMOD

无需接触Core和VQMOD

本文介绍了无需接触Core和VQMOD/OCMOD即可修改OpenCart的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有比使用VQMOD/OCMOD更改OpenCart's核心文件更好的方法?

Is there a better way then using VQMOD/OCMOD to change OpenCart's core files?

是否存在一些替代"文件夹,以便我可以简单地创建与文件结构相对应的任何PHP文件并仅替代核心文件? (就像在PrestaShopMagento中一样).

Is there some "overrides" folder exists so that I can simply create any PHP file corresponding to the file structure and simply override a core file? (Like it is possible in PrestaShop and Magento).

VQMOD/OCMOD不便高度.有人使用任何 hacks&技巧来达到目的?

VQMOD/OCMOD is highly inconvenient.Does someone use any hacks & tricks to achieve the result?

我不想触摸任何核心文件来保持系统清洁和可管理.

I don't want to touch any core files to keep the system clean and manageable.

非常感谢!

推荐答案

使用自定义技巧解决了该问题(并撰写了):

Solved this using a custom hack (and wrote about this there):

例如,您需要在catalog/controller/common/header.php文件中应用很多更改.好消息-您无需制作.ocmod.xml文件即可实现这一目标.

For example, you need to apply a lot of changes in catalog/controller/common/header.php file. Good news — you don't need to make a .ocmod.xml file to achieve this.

只需将原始文件复制到system/storage/modification/catalog/controller/common/header.php并更改所需的任何内容!

Simply copy the original file to system/storage/modification/catalog/controller/common/header.php and change anything you need!

以便您可以覆盖任何文件(控制器,模型,语言,模板,帮助器),并在核心目录之外创建自己的文件!

So that you can override any files (controllers, models, languages, templates, helpers) and create your own files outside the core directory!

注意:您可能会感到失望,为什么它现在可能无法正常工作.这是因为OpenCart的修改系统已关闭.要打开它,只需打开OpenCart的管理面板:扩展名->修改,然后单击蓝色的 Refresh 按钮!

Note: You can be disappointed why it might not work right now. It's because OpenCart's modification system is off. To turn it on simply open OpenCart's admin panel: Extensions —> Modifications and click a blue Refresh button!

注释2 :在system/storage/modification目录下进行任何更改后,请不要单击刷新,因为它会擦除您的文件!

Note 2: Don't click on Refresh after any changes are made under system/storage/modification directory since it wipes off your files!

这篇关于无需接触Core和VQMOD/OCMOD即可修改OpenCart的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 06:49