Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error


tokyo.black

Recommended Posts

Posted

Hello, I am sorry if this is the wrong section. I have been a long time viewer of the forums. Without knowing, you guys have helped me a lot when it came to issues I have had in the past. I am in a bind right now. I can't figure out how to repair this issue I am having.

 

Long story short. I am moving my site from one server to another. Things have been going fairly smooth until now. This is the error I get when attempting to complete checkout.

 

"Fatal error: Cannot instantiate non-existent class: shipping in /public_html/store/checkout_process.php on line 56"

 

Lines 51-58:

"

//MVS start

// load the selected shipping module

if (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'true')){

include(DIR_WS_CLASSES . 'vendor_shipping.php');

} elseif (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'false')){

include(DIR_WS_CLASSES . 'shipping.php');

}

$shipping_modules = new shipping($shipping);

//MVS End

"

Any help would be greatly appreciated! Thanks in advance.

Posted

Okay, I am so not a coder, but do you have shipping set up in your admin?

another thought....

Look to see that you have shipping.php in your includes/classes and includes/modules directorys.

Posted

Thank you for your reply. I have double checked and all of the files seem to be in the correct locations. When you say "set up in your admin" what do you mean exactly? In the admin panel, i have it set to table rate.

Posted
"Fatal error: Cannot instantiate non-existent class: shipping in /public_html/store/checkout_process.php on line 56"

 

Lines 51-58:

//MVS start

// load the selected shipping module

if (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'true')){

include(DIR_WS_CLASSES . 'vendor_shipping.php');

} elseif (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'false')){

include(DIR_WS_CLASSES . 'shipping.php');

}

$shipping_modules = new shipping($shipping);

//MVS End

 

Well, it looks like the problem is "new shipping($shipping)" to me. I can see you've got an 'if' statement above that includes either vendor_shipping.php or shipping.php classes. Have you checked that both these files do in fact contain the shipping class? Suspiciously, one might expect the vendor_shipping.php file to contain the vendor_shipping class instead? Sorry, but I haven't got the vendor_shipping.php file to see because it isn't part of the stock osC - must be a contribution you've added?

 

Perhaps you need to check the install of the contribution to see you haven't missed anything in the code in this area?

Posted

Hey, hold on a minute, it's not an 'if then else' it's an 'if then elseif', so it might be possible that neither vendor_shipping.php or shipping.php classes get included before then making use of the shipping class. That is weird logic isn't it?

 

Perhaps also you should check whether you have defined SELECT_VENDOR_SHIPPING anywhere (in your database?). If that is missing or not defined then perhaps both statements will end up as 'false' if $total_weight > 0.

 

Pop a line in like:

if (!defined('SELECT_VENDOR_SHIPPING') { die('SELECT_VENDOR_SHIPPING is not defined!'); }

 

to see that it is actually set to either true or false.

Posted
Hey, hold on a minute, it's not an 'if then else' it's an 'if then elseif', so it might be possible that neither vendor_shipping.php or shipping.php classes get included before then making use of the shipping class. That is weird logic isn't it?

 

Perhaps also you should check whether you have defined SELECT_VENDOR_SHIPPING anywhere (in your database?). If that is missing or not defined then perhaps both statements will end up as 'false' if $total_weight > 0.

 

it may not be the SELECT_VENDOR_SHIPPING. is your weight equal to 0? that would cause both if tests to fail and therefore not include the shipping code. you might just add a

else include(DIR_WS_CLASSES . 'shipping.php');

 

after that last close brace. that'll act as a catch-all and at least include something.

Archived

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

×
×
  • Create New...