Post by Lumirion » Thu Jul 18, 2024 3:06 am

On an Opencart 3.0.3.3 server I keep running into an issue when I use the constant DIR_CATALOG. It keeps throwing:

Code: Select all

Warning: Use of undefined constant DIR_CATALOG - assumed 'DIR_CATALOG' (this will throw an Error in a future version of PHP)
when ever I refer to it. I checked config.php and it is clearly defined. Any one else run into this? This server someone else built. If it helps I also saw this on a version 3.0.3.9 test server I built from scratch.

On my server using DIR_TEMPLATE, instead of DIR_CATALOG, and adjusting relevant paths is a functional work around.

Any one Know why this would be?
Last edited by Lumirion on Tue Jul 23, 2024 10:08 pm, edited 1 time in total.

New member

Posts

Joined
Fri Apr 19, 2024 1:32 am

Post by nonnedelectari » Thu Jul 18, 2024 7:42 am

Lumirion wrote:
Thu Jul 18, 2024 3:06 am
On an Opencart 3.0.3.3 server I keep running into an issue when I use the constant DIR_CATALOG. It keeps throwing:

Code: Select all

Warning: Use of undefined constant DIR_CATALOG - assumed 'DIR_CATALOG' (this will throw an Error in a future version of PHP)
when ever I refer to it. I checked config.php and it is clearly defined. Any one else run into this? This server someone else built. If it helps I also saw this on a version 3.0.3.9 test server I built from scratch.

On my server using DIR_TEMPLATE, instead of DIR_CATALOG, and adjusting relevant paths is a functional work around.

Any one Know why this would be?
Defined in both config.php?

New member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by JNeuhoff » Thu Jul 18, 2024 5:50 pm

You need to provide some more details for more help here. The DIR_CATALOG is only defined in the admin/config.php, hence it can only be used in the admin controllers, not in frontend controllers.

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 paulfeakins » Thu Jul 18, 2024 7:12 pm

Lumirion wrote:
Thu Jul 18, 2024 3:06 am
Any one Know why this would be?
Perhaps a PHP version change at a guess?

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


User avatar
Guru Member
Online

Posts

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

Post by Lumirion » Fri Jul 19, 2024 12:14 am

Thank you guys for the tips. @nonnedelectari , I located it in two config.php files though one appears to be a backup. Noted that the DIR_TEMPLATE has a different definition in config.php from the front end version of the define I'm using, as @JNeuhoff explained. I haven't located the file that defines constants that are in scope for front end controllers yet. Any one know where that is?

New member

Posts

Joined
Fri Apr 19, 2024 1:32 am

Post by JNeuhoff » Fri Jul 19, 2024 4:24 pm

Lumirion wrote:
Fri Jul 19, 2024 12:14 am
Thank you guys for the tips. @nonnedelectari , I located it in two config.php files though one appears to be a backup. Noted that the DIR_TEMPLATE has a different definition in config.php from the front end version of the define I'm using, as @JNeuhoff explained. I haven't located the file that defines constants that are in scope for front end controllers yet. Any one know where that is?
The frontend config.php file is located in your OpenCart root folder, and it should not have the DIR_CATALOG in there, the latter is only declared in the admin/config.php.

As said, if you need help, then you have to provide some more details.

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 nonnedelectari » Fri Jul 19, 2024 7:39 pm

Lumirion wrote:
Fri Jul 19, 2024 12:14 am
Thank you guys for the tips. @nonnedelectari , I located it in two config.php files though one appears to be a backup. Noted that the DIR_TEMPLATE has a different definition in config.php from the front end version of the define I'm using, as @JNeuhoff explained. I haven't located the file that defines constants that are in scope for front end controllers yet. Any one know where that is?
If you use a constant in admin side, it needs to be defined in the admin config.
if you use a constant in the catalog side, it needs to be defined in the catalog config.
if you use a constant in the system side, it needs to be defined in both.

New member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by Lumirion » Tue Jul 23, 2024 10:06 pm

Ah! Nice! We don't even have a catalog/config.php. That would explain it. When I get time I'll try and make one.

New member

Posts

Joined
Fri Apr 19, 2024 1:32 am

Post by JNeuhoff » Tue Jul 23, 2024 10:42 pm

Lumirion wrote:
Tue Jul 23, 2024 10:06 pm
Ah! Nice! We don't even have a catalog/config.php. That would explain it. When I get time I'll try and make one.
There is no catalog/config.php in OpenCart!
There is a config.php in the OpenCart root folder, and another one in the admin folder.

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

Who is online

Users browsing this forum: No registered users and 15 guests