Guest Posted August 29, 2006 Share Posted August 29, 2006 can't figure out what's causing it. here is the error: Warning: Invalid argument supplied for foreach() in /home/Websites/auctionlot/includes/functions/indvshipzones.php on line 58 Here is the code around that line: } function Display($product_id) { $return = "<table class='main'><tr>"; $nZones = count(GetAllZones()); $i = 1; foreach(GetAllZones() as $key=>$value) { $finLigne = ""; if ($i==$nZones) { // Cherche la fin de tableau $modulo = $i%3; // Nombre de cellules vides restantes for ($x=0; $x<=$modulo; $x++) { $finLigne .= "<td></td><td></td>"; } Quote Link to comment Share on other sites More sharing options...
Otto Posted August 29, 2006 Share Posted August 29, 2006 i have the same exact problem. can someone please help? Quote Link to comment Share on other sites More sharing options...
tahuti Posted September 22, 2006 Share Posted September 22, 2006 i have the same exact problem. can someone please help? im guessing that the get all zones function query is coming up null......in the same file but the first function up top.....get rid of the where and AND statements and just pull all the stuff from the zones table and it seems to work..... Quote Link to comment Share on other sites More sharing options...
emmet11 Posted June 2, 2007 Share Posted June 2, 2007 Anyone can help us?? Quote Link to comment Share on other sites More sharing options...
jimmygreaves Posted June 6, 2007 Share Posted June 6, 2007 I'm struggling with this contribution too. I'm getting the same error as above but I don't understand why - All my tax zones are set up correctly. Anybody had any sucess with this contribution, I need it to work because it's exactly what I need on my client's store. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 23, 2007 Share Posted November 23, 2007 (edited) Anyone can help us?? The code function GetAllZones() { $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones as z,countries as c, configuration as co, geo_zones as g WHERE co.configuration_value = g.geo_zone_id AND co.configuration_key = 'MODULE_SHIPPING_INDVSHIP_ZONE' AND g.geo_zone_name = c.countries_name AND c.countries_id=z.zone_country_id"); while ($row = tep_db_fetch_array($zones_query)) { $array[$row['zone_code']] = $row['zone_name']; } return $array; } Edited November 23, 2007 by davchi2005 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 20, 2008 Share Posted February 20, 2008 It would be really nice to get this working. I have a customer that sells large items, and they have a fixed shipping cost to different parts of the country, per item. If anyone can help with this then that would be great (and paid for) Quote Link to comment Share on other sites More sharing options...
Guest Posted February 20, 2008 Share Posted February 20, 2008 I am getting the following error: Port par zone: - Warning: Invalid argument supplied for foreach() in /home/shop/public_html/includes/functions/indvshipzones.php on line 58 Not to sure why. Fresh install of OSC Quote Link to comment Share on other sites More sharing options...
Warpz Posted March 19, 2008 Share Posted March 19, 2008 I am also getting the error noted below, along with the error listed above. Any help for either would be greatly appreciated. Thanks. I am getting the following error: Port par zone: - Warning: Invalid argument supplied for foreach() in /home/shop/public_html/includes/functions/indvshipzones.php on line 58 Not to sure why. Fresh install of OSC Quote Link to comment Share on other sites More sharing options...
jstar Posted May 18, 2008 Share Posted May 18, 2008 I have solved the problem and got this module working. Here's what I did: In the indvship.php module file itself, change the $shiptotal variable definition in the quote() function to: $shiptotal = $cart->get_shiptotal(); In the indvshipfunctions.php file in the /includes/functions directory, change the GetAllZones() function to the following: function GetAllZones() { /* $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones as z,countries as c, configuration as co, geo_zones as g WHERE co.configuration_value = g.geo_zone_id AND co.configuration_key = 'MODULE_SHIPPING_INDVSHIP_ZONE' AND g.geo_zone_name = c.countries_name AND c.countries_id=z.zone_country_id"); */ $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones as z"); while ($row = tep_db_fetch_array($zones_query)) { $array[$row['zone_code']] = $row['zone_name']; } /* echo "<pre>" . print_r($array) . "</pre>"; */ return $array; } In the same function, change SetPrices() to the following: function SetPrices($product_id, $zone_code, $price=0) { $zones_query = tep_db_query("SELECT zone_code FROM indvshipzones WHERE product_id = ".$product_id." AND zone_code = \"".$zone_code."\""); if ($row = tep_db_fetch_array($zones_query)) { tep_db_query("UPDATE indvshipzones SET product_id=$product_id, zone_code='$zone_code', price=$price WHERE product_id = ".$product_id." AND zone_code = '".$zone_code."'"); } else { tep_db_query("INSERT INTO indvshipzones (product_id, zone_code, price) VALUES ($product_id, '$zone_code', $price)"); } } In categories.php, change the GetAllZones() function call to the following: // START INDVSHIPZONES foreach(GetAllZones() as $key=>$value) { /* print 'key is' . $key . '<br />'; print 'value is' . $value . '<br />'; print 'post value is ' . $HTTP_POST_VARS[$value] . '<br />'; print 'post value is ' . $HTTP_POST_VARS[$key] . '<br />'; print '<pre>' . print_r($HTTP_POST_VARS) . '</pre>'; */ if(isset($HTTP_POST_VARS[$key])) { SetPrices((int)$products_id, $key, $HTTP_POST_VARS[$key]); } } // END INDVSHIPZONES } I think these are the only changes required to get it working. I also had a problem with the shipping method not displaying in the checkout, but I fixed that by commenting out the strange exception for indvship (whose purpose I could not discover) in the shipping.php class file. Hope this helps! vyung 1 Quote Link to comment Share on other sites More sharing options...
WebWiz1 Posted August 5, 2008 Share Posted August 5, 2008 Thanks jstar, I did your changes and that got me most of the way there. I got one more error during checkout and found that in \includes\classes\shipping.php at about line 20, I needed to change global $language, $PHP_SELF; to global $language, $PHP_SELF, $cart; Hope it helps the next person. Seems to be working fine in RC1 now. Quote Link to comment Share on other sites More sharing options...
TROQUELADO Posted March 20, 2009 Share Posted March 20, 2009 (edited) Anyone knows how to make this module to take the zones from the edited taxes zones? I think the tables name im refering is zones_to_geo_zones. I have been attempting to modify the functions file indvshipzones.php for hours, but im a roockie on mysql querys, i need some help, i am desperating. :( Thanks!! The original file does this query: $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones as z"); Edited March 20, 2009 by TROQUELADO Quote Link to comment Share on other sites More sharing options...
ntd Posted November 5, 2009 Share Posted November 5, 2009 I used the original query: $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones z, countries c, configuration co, geo_zones g WHERE co.configuration_key = 'MODULE_SHIPPING_INDVSHIP_ZONE' AND co.configuration_value = g.geo_zone_id AND g.geo_zone_name = c.countries_name AND c.countries_id = z.zone_country_id"); In the tax zones I used the country (USA) and added all of states I wanted in "details". I created a new country USA instead of United Sates and added the states I wanted to use in zones first. This gave me only the states I want to use and not everything in zones. Hope this helps Anyone knows how to make this module to take the zones from the edited taxes zones? I think the tables name im refering is zones_to_geo_zones. I have been attempting to modify the functions file indvshipzones.php for hours, but im a roockie on mysql querys, i need some help, i am desperating. :( Thanks!! The original file does this query: $zones_query = tep_db_query("SELECT z.zone_code, z.zone_name FROM zones as z"); Quote Link to comment Share on other sites More sharing options...
vyung Posted December 8, 2009 Share Posted December 8, 2009 Thanks to jstar. I have gotten rid of all the errors. However, I still don't see how you can input the shipping price per zone for each product in the Admin panel. Can anyone shed some light on this? Any help will be greatly appreciated. I am eager to get my store running! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.