Post by Kenberne1965 » Tue Apr 19, 2016 10:04 pm

Hi everyone, hope your all well, Ive started building OC extensions again, but it seams things have changed quite a bit when it comes to installing them into opencart 2.1 and above.

Is there a guide somewhere that explains all this, when i last made extensions, it was simply a matter of uploading them via ftp and you was done.

Now it seams all a little bit complicated, and do we use VQmod or OCmod? ive always used VQmod and this would be my mod of choice unless OCmod has taken over?

Any pointers appreciated, maybe it just seams more complicated than it really is.

Paul ;D

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by Kenberne1965 » Wed Apr 20, 2016 3:03 pm

Thats what I love about open cart, people falling over themselfs to help ;)

after a bit of research I see you can create a .ocmod.zip with an upload folder and optional install.php, install.sql and a required install.xml

but I need to know what should be in these files, obviously I know my files go in the uploads folder in the opencart structure, but what goes in the .php and more importantly the required .xml? ???

Again any help would be appreciated, I tried it without the install.xml file but it fails to upload giving a directory not found error.

Paul

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by artcore » Wed Apr 20, 2016 4:16 pm

If you only have changes to the core then you can just use yourfile_name.ocmod.xml
If you want to (also) add new files, use the upload folder as you've found out. If you only want to add new files I guess you can have an empty install.xml (with default tags for author,version etc)
iow install.xml is the former vqmod xml but with ocmod syntax (position to 'add' tag, index starts at 0, less robust search)

I use install.php for adding db tables, layouts, admin permissions and so on. I'm not sure if install.sql is useful as the db prefix is unknown
If you have an installable module(from extension page) the install() function can also act as install.php

Hope this helps :)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by Kenberne1965 » Wed Apr 20, 2016 9:26 pm

Thanks for the help,
So am i thinking correctly that the .php page is simply executed upon uploading? so any setup etc can be put in that.
because im not building a module im more adding to the core functionality with my latest project, I don't have access to the install() but I sort of wrote my own in the code that takes care of creating a database and adding default data on its first run, (ie. if the database table does not exist, which makes it handy as to reset the data, all you need to do is drop the database and re-run the add-on by clicking on it in the main menu).

What i have is some new php files, in admin controller, model, language and a few changes to the core front end with VQMod.

I did try it with .ocmod.zip as the file extension but had no luck installing it through the extension installer, I`ll try again with a blank .xml file and see what happens.

Paul

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by artcore » Wed Apr 20, 2016 9:54 pm

Look for an ocmod extension by iSense called localcopy. It bypasses the need for ftp credentials.
Indeed using the optional install.php you can run code upon installing the ocmod. Or in your controller index or construct have some sort of init for db tables and what not...
Cheers

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by Kenberne1965 » Wed Apr 20, 2016 10:22 pm

yeah, i use localcopy :)

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by nsweb » Wed Apr 20, 2016 11:48 pm

You can read there about differences between OCMOD and VQMOD - https://github.com/opencart/opencart/wi ... ion-System

Image
Icecat Integration
Products datasheets (name, full description, images, features, barcodes)
http://www.opencart.com/index.php?route ... n_id=25976


Newbie

Posts

Joined
Mon Apr 04, 2016 10:00 pm
Who is online

Users browsing this forum: No registered users and 3 guests