Post by Qphoria » Mon Jul 09, 2018 12:19 pm

OpenCart 3.0 has a nifty theme editor built into the admin now. It allows you to edit the template files through the admin, but when you save, it doesn't modify the original file. Instead, it saves the file with the modification to the database and when the page is loaded, if an override exists in the database, it will serve up this saved version instead of the file version.

But since ocmod and vQmod are both made to trigger on physical files as they are included, this override process bypasses both modification systems.

So this is a free simple script to save that database output to a temp file, and then pass that temp file into vQmod to apply any scripts to the modified version. It won't add ocmod support however as that has to be handled differently, but at least vQmod scripts will now trigger correctly on this override content.

In the case of errors, it will still report the original file (not the temp override file) as not having a match, so be conscientious of that.
vqcache files will match the temp override name which will be in this naming format:

Code: Select all

vq2-system_storage_override_common_home.php
Just drop this script into your vqmod/xml folder. Only works with 3.0 or later.

Attachments

vqmod theme override support


Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by straightlight » Mon Jul 09, 2018 8:35 pm

Is this provided solution also on your GitHub page?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Qphoria » Mon Jul 09, 2018 9:37 pm

Technically since vQmod is a file-based system, it doesn't really belong in the official release so it's released as a separate script. However, it might make sense to rewrite or add another modCheck-like function to support passing in strings as well as files as the source. But that's something we'll need to think about. For now, this is a simple enough workaround.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by straightlight » Mon Jul 09, 2018 10:17 pm

No problem. However, this topic may be lost in the mud pretty quick and that is if there are any muds left. Otherwise, while reflection needs to be made regarding an additional set of class from your package, perhaps setting this topic as sticky would be ideal.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 199 guests