Page 1 of 1

Best practice extension development / git workflow

Posted: Wed Jun 08, 2022 6:17 pm
by ndeet
Hi,

I'm new to OpenCart and developing a payment extension. I wonder if there is any best practice on how you do development without editing the files directly in the OpenCart directories (and copying them back to your git repo)? Or do you always re-install the extension with each code change?

One solution would be to create a symlink for each single file but I wonder if you have any other solution to this problem?

Re: Best practice extension development / git workflow

Posted: Thu Jun 09, 2022 4:29 am
by straightlight
ndeet wrote:
Wed Jun 08, 2022 6:17 pm
Hi,

I'm new to OpenCart and developing a payment extension. I wonder if there is any best practice on how you do development without editing the files directly in the OpenCart directories (and copying them back to your git repo)? Or do you always re-install the extension with each code change?

One solution would be to create a symlink for each single file but I wonder if you have any other solution to this problem?
Depends on the OC version you use. The latest does support namespaces but the documentation is not ready, yet. As for OC v3.x releases, you could use OCMod and / or Event Triggers to accomplish this.

Re: Best practice extension development / git workflow

Posted: Fri Jun 10, 2022 7:58 pm
by ndeet
Thanks for the reply, will look what your suggestions are all about.

I decided to go with OC3 for now as it seems to be widely used and OC4 was just released and not yet many payment plugins available but looking forward to cover OC4 too. Can OC3 + 4 covered in a single branch codebase or are there too many breaking changes that it makes more sense to have separate branches and releases?

Re: Best practice extension development / git workflow

Posted: Sat Jun 11, 2022 12:30 am
by ADD Creative
There will be too many changes between version 3 and 4.