Post by pvint » Thu Feb 19, 2015 6:27 am

Hi all - I'm new around here, and am tasked with making some extensions and looking for some advice from those who have already made some mistakes!

In developing an extension that changes files, what method do you use? I have been trying to keep the files in their own directory, make my edits, then re-import the extension into OC, but I find it's cumbersome and time consuming.

In the one I'm working on now I've set up a dummy site and am just editing the files in place, figuring I can figure out how to fins and package the files later. Obviously this could be problematic when it comes to trying to figure out what I've changed (and I sure wish I had started out with a version control like git before I started making changes... next time)

Anyway - how do you prefer to handle this?

Cheers,
Paul

Newbie

Posts

Joined
Thu Feb 19, 2015 6:20 am


Post by IP_CAM » Fri Feb 20, 2015 8:13 am

Usually, Extensions are created as 'VqMod's, around here. They mostly allow modifications without the need to modify 'Source' Code. If a 'Task' cannot be 'solved' this way, they are 'combined' with regular, but specifically 'named' source code files, placed within the OC 'Surrounding'. Anything else will not be a success, I assume...
Good Luck
Ernie
bigmax.ch/shop/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Mon Feb 23, 2015 12:49 am

There are several ways to modify OpenCart core files, indirectly, without touching the original files:

1)
OCMod, OpenCart's builtin XML-based modification system, see https://github.com/opencart/opencart/wi ... ion-System

2)
VQmod, another XML-based modification system, of which there are 2 available to choose from:

2) a) http://www.opencart.com/index.php?route ... n_id=19501
2) b) https://github.com/vqmod/vqmod/wiki

3)
Override Engine, which allows the developer to extend most of the OC core classes and override their methods, see http://www.opencart.com/index.php?route ... on_id=8588

4)
OpenCart's built-in event system, using a simple mediator design pattern, see https://github.com/opencart/opencart/wi ... cations%29

Using options 3) and/or 4) are the most robust ones, using 1) or 2) are a bit more flexible, but also more dangerous (3rd party VQmod/OCmod XML-based extensions often clash with each other!)

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by pvint » Tue Feb 24, 2015 9:33 am

Excellent replies - thanks!

I wasn't aware of either Override Engine nor the event system.... I love the idea of the event system - it sounds like an elegant way to handle an extension.

For the stuff I've already worked on I've been monkeying with the files in place, figuring I'll just use diff to find all my changes when I'm done then create the OCMod XML, and I expect it to be a pain, but it got me started quickly.

Today I was working on a minor payment mod and since I'm not done yet maybe I'll back up and look into events.

Good stuff - thanks again

Paul

Newbie

Posts

Joined
Thu Feb 19, 2015 6:20 am

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests