Quote Originally Posted by s-thomas View Post
Hi there

I just installed the module and am running into an issue that I have tracked down to the (IS_ADMIN_FLAG === true) in the /includes/classes/shipping file.
I am using Edit orders 4.1.7 and running Zen Cart 1.5.4

In the admin section the pages are not loading because of an file load error. If I hack the IS_ADMIN_FLAG then the pages loads with out errors. I am going with the assumption that there is an issue with the admin files calling the catalog files or that there is an issue with using a shipping file that is a core 1.5.5a when I am running 1.5.4. Any help would be appreciated.
Thanks


Code:
if (IS_ADMIN_FLAG === true) {
          $lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
          $module_file = DIR_FS_CATALOG . $module_file;
        } else {
        $lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/shipping/', $include_modules[$i]['file'], 'false');
        }

[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning: include_once(includes/modules/shipping/canadapost.php): failed to open stream: No such file or directory in /home/xxx/public_html/includes/classes/shipping.php on line 64
[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Warning: include_once(): Failed opening 'includes/modules/shipping/canadapost.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/includes/classes/shipping.php on line 64
[20-Mar-2018 13:50:06 America/Los_Angeles] PHP Fatal error: Class 'canadapost' not found in /home/xxx/public_html/includes/classes/shipping.php on line 65

I have just come across this issue. I have used Edit Orders extensively previously without seeing this.

Definitely, seems to be a relative path issue when the shipping modules are loaded from admin. The original OP says the file is there. Well, actually that is not strictly true. The current working directory is admin, so the inclusion of 'includes/modules/shipping/canadapost.php' in his case fails. And it should fail because we are in the admin folder.

If the CWD was the root directory this inclusion would work on his/her server. So, this is what I encountered anyway. My resolution to it was to change the CWD just before the shipping modules are included and then return it back to admin afterwards. Now everything works.

I am not sure if this is server specific, or php version specific. Someone with more sysadmin experience than me can comment about that. I guess there must be some complication if not everyone is experiencing this.

Nick