Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom Module Gives Strange Errors But Works!


Loopy

Recommended Posts

I get these messages:

 

Warning: main(/home/[user]/public_html/shop/includes/languages/english/modules/shipping/dhlzone1.php): failed to open stream: No such file or directory in /home/kigurumi/public_html/shop/admin/modules.php on line 128

 

Warning: main(/home/[user]/public_html/shop/includes/languages/english/modules/shipping/dhlzone1.php): failed to open stream: No such file or directory in /home/kigurumi/public_html/shop/admin/modules.php on line 128

 

Warning: main(): Failed opening '/home/kigurumi/[user]/shop/includes/languages/english/modules/shipping/dhlzone1.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kigurumi/public_html/shop/admin/modules.php on line 128

 

When attempting to access my custom-made shipping module. The module works perfectly, but I get this message at the top of the screen each time. Even if I create a dummy dhlzone1.php file with just the following:

 

<?
 echo "TEST";
?>

 

You will see the TEST message after the error messages, and then the list will be displayed after this.

 

Does anyone know why this is happening?

 

 

Loopy

Link to comment
Share on other sites

Does anyone know why this is happening?
By default the class shipping looks for a language file for every shipping module: see around line 60 in classes/shipping.php:

        for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
         include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);
         include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

So basically that code is looking for dhlzone1.php in the languages directory:

includes/languages/english/modules/shipping/dhlzone1.php

whereas your custom shipping module is in includes/modules/shipping/.

I guess it will be sufficient to put an empty file with that name in that directory and not see that error anymore.

Link to comment
Share on other sites

By default the class shipping looks for a language file for every shipping module: see around line 60 in classes/shipping.php:

 ? ? ? ?for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
? ? ? ? ?include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);
? ? ? ? ?include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

So basically that code is looking for dhlzone1.php in the languages directory:

includes/languages/english/modules/shipping/dhlzone1.php

whereas your custom shipping module is in includes/modules/shipping/.

I guess it will be sufficient to put an empty file with that name in that directory and not see that error anymore.

 

Hmmm. I'll mess around with the locations a bit and see what happens.

 

Oh, and Johnson/Matti -- this module is only a slight customisation of the zones.php with some pre-made static prices, so you don't need to download it... :)

 

 

Loopy

Link to comment
Share on other sites

Hmmm. I'll mess around with the locations a bit and see what happens.

 

Oh, and Johnson/Matti -- this module is only a slight customisation of the zones.php with some pre-made static prices, so you don't need to download it... :)

Loopy

 

Yep, it worked! I created a blank dummy file in the english/shipping directory and the message disappeared. I guess I could now move all the define() statements into here to allow for easy translations in future, but I'll worry about that some other time.

 

Thanks for the pointers, anyway, JanZ

 

 

Loopy

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...