Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Regarding these errors:

 

 

Warning: Invalid argument supplied for foreach() in /home/stomp/public_html/checkout_process.php on line 125

 

Warning: Cannot modify header information - headers already sent by (output started at /home/stomp/public_html/checkout_process.php:125) in /home/stomp/public_html/includes/functions/general.php on line 29

 

I know some people have had this problem as well, but I have not been able to find a definitive solution in this forum thread. I went line by line to find out at what point this error happens and have narrowed it down. But I still do not know how to fix. Any assistance would be excellent!

 

In the MVS mod when you add this chunk of code you get the error:

 

//MVS - added insert for new orders_shipping table

$shipping_array = $shipping['vendor'];

foreach ($shipping_array as $vendors_id => $shipping_data) {

$vendors_query = tep_db_query("select vendors_name

from " . TABLE_VENDORS . "

where vendors_id = '" . (int)$vendors_id . "'"

);

$vendors_name = 'Unknown';

if ($vendors = tep_db_fetch_array($vendors_query)) {

$vendors_name = $vendors['vendors_name'];

}

$shipping_method_array = explode ('_', $shipping_data['id']);

if ($shipping_method_array[0] == 'fedex1') {

$shipping_method = 'Federal Express';

} elseif ($shipping_method_array[0] == 'upsxml') {

$shipping_method = 'UPS';

} elseif ($shipping_method_array[0] == 'usps') {

$shipping_method = 'USPS';

} else {

$shipping_method = $shipping_method_array[0];

}

$sql_data_array = array('orders_id' => $insert_id,

'vendors_id' => $vendors_id,

'shipping_module' => $shipping_method,

'shipping_method' => $shipping_data['title'],

'shipping_cost' => $shipping_data['cost'],

'shipping_tax' => $shipping_data['ship_tax'],

'vendors_name' => $vendors_name,

'vendor_order_sent' => 'no'

);

tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array);

}

//MVS End

Posted

Definitive answer:

 

There are additional settings that need to be set:

 

1 - ensure that under Configuration/Shipping and Packaging you have setup the settings for the vendors.

 

2 - Under Vendors, make sure that for each one that you have set up the correct shipping method and have addresses set up if you are using automated calculations like usps.

 

3 - Under Modules/Shipping, make sure you have nothing configured. Instead for your default store it is set up as a vendor called "My Store". Setup your default shipping here. If you have both set, you will get errors that don't make normal-human-sense. (can you tell I've been there, done that?)

 

After all the settings were right, whalla! it worked like a charm.

 

Thank you for the great mod, it was exactly what we needed. :)

Posted

Thanks for the reply! Unfortunately, I don't follow all of it.

 

1. When you say vendors do you mean Manufacturers? I don't have Vendors (that I know of).

 

2. I use USPS and UPS conttributions in the Modules/Shipping. It doesn't seem possible to set these up under "My Store" Also, under My Store there is no place to set the default shipping.

 

I'll search through the forums but do you have any thoughts?

  • 9 months later...
Posted
Regarding these errors:

Warning: Invalid argument supplied for foreach() in /home/stomp/public_html/checkout_process.php on line 125

 

Warning: Cannot modify header information - headers already sent by (output started at /home/stomp/public_html/checkout_process.php:125) in /home/stomp/public_html/includes/functions/general.php on line 29

 

I know some people have had this problem as well, but I have not been able to find a definitive solution in this forum thread. I went line by line to find out at what point this error happens and have narrowed it down. But I still do not know how to fix. Any assistance would be excellent!

 

I found for my store that i needed to take into account virtual orders (i.e.downloads) and wrap the

MVS code with

if ($order->content_type != 'virtual') {

 

//MVS - added insert for new orders_shipping table

$shipping_array = $shipping['vendor'];

foreach ($shipping_array as $vendors_id => $shipping_data) {

....

}

 

and then this worked.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...