Post by treii28 » Fri Mar 01, 2024 11:35 pm

I'm not finding a lot of documentation on the specifics of extension best practices in opencart 4. So I'm wondering the 'opencart' way of using external libraries?

What I have been able to work out is that they seem to drop such files in a folder like

Code: Select all

myextension/system/library/myextension
so that's where I'm locating a composer.json file. But it's not clear if that will automatically result in composer install running or if I need to add something in a admin/model/myextension->install() function or something. It's also unclear how the vendor/autoload.php is included.

What is the best-practices/opencart way of including such an external library when installing/uninstalling and then have those files included when calling on the extension?

SW

Newbie

Posts

Joined
Wed Jan 31, 2024 5:48 am

User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Mon Mar 04, 2024 11:57 pm

JNeuhoff wrote:
Sat Mar 02, 2024 2:25 am
Are you using OpenCart 3, or OpenCart 4?
They have mentioned OC 4 in the post title and the text, unless they added that after your question.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Tue Mar 05, 2024 2:19 am

paulfeakins wrote:
Mon Mar 04, 2024 11:57 pm
JNeuhoff wrote:
Sat Mar 02, 2024 2:25 am
Are you using OpenCart 3, or OpenCart 4?
They have mentioned OC 4 in the post title and the text, unless they added that after your question.
In that case it's posted in the wrong forum section.

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by treii28 » Wed Mar 06, 2024 3:32 am

re: wrong forum section

What is the 'right' forum section if not 'OpenCart Community Forum -> Opencart 4.0 Support -> Extensions Support' when asking for support on opencart 4.0 extensions?

Newbie

Posts

Joined
Wed Jan 31, 2024 5:48 am

Post by straightlight » Wed Mar 06, 2024 7:33 am

treii28 wrote:
Fri Mar 01, 2024 11:35 pm
I'm not finding a lot of documentation on the specifics of extension best practices in opencart 4. So I'm wondering the 'opencart' way of using external libraries?

What I have been able to work out is that they seem to drop such files in a folder like

Code: Select all

myextension/system/library/myextension
so that's where I'm locating a composer.json file. But it's not clear if that will automatically result in composer install running or if I need to add something in a admin/model/myextension->install() function or something. It's also unclear how the vendor/autoload.php is included.

What is the best-practices/opencart way of including such an external library when installing/uninstalling and then have those files included when calling on the extension?

SW
There are no official documentation for this, yet. From the Marketplace, there might be some free examples on how to pull vendors packages with external libraries.

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 2 guests