Post by Joe1234 » Tue Jun 03, 2025 10:45 am

In going through some modified files I notice some functions have multiple model loads of the same file in the same function. Does opencart disregard secondary loads of the same include file, or are the files actually being loaded multiple times? What's the best way to address this? I have what I call a "general fix" ocmod for my setup, where I include simple one liner things that I need rectified throughout opencart, I was thinking of deleting the commenting out the insertion of that load logic in the ocmods and then inserting one call to load that model in my "general fix" so it works for all the ocmods that need it. Any better solutions? Or is this just not needed?
Last edited by Joe1234 on Wed Jun 04, 2025 3:57 pm, edited 1 time in total.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by paulfeakins » Tue Jun 03, 2025 6:11 pm

Joe1234 wrote:
Tue Jun 03, 2025 10:45 am
In going through some modified files I notice some functions have multiple model loads of the same file in the same function.
Give us an example.

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 Jun 03, 2025 6:18 pm

It only uses one model instance, even when you call the $this->load->model(....) multiple times for the same route.
See the system/engine/loader.php.

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 Joe1234 » Wed Jun 04, 2025 3:57 pm

Thanks

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am
Who is online

Users browsing this forum: lockiedownunder and 28 guests