mikerat Posted January 30, 2003 Posted January 30, 2003 Zone 1 (UK 1st Class Royal Mail and Courier(>5kg)) Country ISO Codes GB,UK Shipping Table .10:0.41,.20:0.72,.30:0.96,.40:1.30,.50:1.66,.60:2.00,.70:2.51,.80:2.91,.90:3.20 ,1.00:3.49,1.25:4.34 ,1.50:5.19,1.75:6.04,2.00:6.89,5.00:17.09,20.00:68.09,30.00:102.09,40.00:136.09, 999.00:1000.00 Zone 2 (Europe 1st Class Royal Mail and Courier(>5kg)) Country ISO Codes AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CY,CZ,CS,DK,EE,MK,FO,FI,FR,FX,GE,DE,GI,GR,GL,HU,IS ,IE,IT,KZ,KG,LV,LI,LT,LU,MT,MD,MC,NL,NO,PL,PT ,RO,RU,SM,SK,SI,ES,SE,CH,TJ,TR,TM,UA,UZ,VA,YU Shipping Table .30:1.83,.40:2.28,.50:2.73,.60:3.21,.70:3.71,.80:4.20,.90:4.65,1.00:5.10,1.10:5. 55,1.20:6.00,1.30:6. 45,1.40:6.90,1.50:7.35,1.60:7.80,1.70:8.25,1.80:8.70,1.90:9.15,2.00:9.60,5.00:25 .00,20.00:37.50,30.00:45.95,40.00:55.95,999. 00:1000.00 Zone 3 (World Zone 1 1st Class Royal Mail and Courier(>5kg)) Country ISO Codes AF,DZ,AO,AV,AI,AG,AR,AW,BS,BH,BD,BB,BZ,BJ,BM,BT,BO,BW,BR,IO,BN,BF,BI,KH,CM,CA,CV ,KY,CF,TD,CL,CX,CC,CO,KM,CG,CD,CR,CI,CU,DJ,DM ,DO,EC,EG,SV,GQ,ER,ET,FK,GF,GA,GM,GH,GD,GP,GT,GN,GW,GY,HT,HN,HK,IN,ID,IR,IQ,IL,J M,JO,KE,KW,LA,LB,LS,LR,LY,MO,MG,MW,MY,MV,ML,M Q,MR,MU,YT,MX,MS,MA,MZ,MM,NA,NP,AN,NI,NE,NG,OM,PK,PA,PY,PE,PR,QA,RE,RW,GS,KN,LC, VC,ST,SA,SN,SC,SL,SG,SO,ZA,LK,SH,PM,SD,SR,SZ, SY,TZ,TH,TG,TT,TN,TC,UG,AE,US,UY,UM,VE,VN,VG,VI,YE,ZR,ZM,ZW Shipping Table .50:4.77,.60:5.67,.70:6.57,.80:7.47,.90:8.37,1.00:9.27,1.10:10.17,1.20:11.07,1.3 0:11.94,1.40:12.79,1 .50:13.64,1.60:14.49,1.70:15.34,1.80:16.19,1.90:17.04,2.00:17.89,5.00:65.00,20.0 0:105.00,30.00:130.00,40.00:160.00,999.00: 1000.00 Zone 4 (World Zone 2 1st Class Royal Mail and Courier(>5kg)) Country ISO Codes AS,AQ,AU,BV,CN,CK,TP,FJ,PF,TF,GU,HM,JP,KI,KP,KR,MH,FM,MN,NR,NT,NC,NZ,NU,NF,MP,PW ,PG,PH,PN,WS,SB,SJ,TW,TK,TO,TV,SU,VU,WF,EH Shipping Table .50:5.21,.60:6.21,.70:7.21,.80:8.21,.90:9.21,1.00:10.21,1.10:11.21,1.20:12.21,1. 30:13.21,1.40:14.21, 1.50:15.21,1.60:16.21,1.70:17.21,1.80:18.21,1.90:19.21,2.00:20.21,5.00:65.00,20. 00:105.00,30.00:130.00,40.00:160.00,999.00: 1000.00 Quote
Guest Posted June 5, 2003 Posted June 5, 2003 Help! I've installed this contribution to a previously fully functional store & now it doesn't offer any shipping options when trying to checkout. I got an error message saying there was a problem with the syntax when I ran the SQL changes, but I can't figure out how to fix it. Quote
livefooduk Posted June 5, 2003 Posted June 5, 2003 There are no SQL changes to run, you need to add those countries and rates to your zones shipping module in Admin>modules>shipping I would sugest you click the red button for zones in Admin>modules>shipping to de-activate that module then click the green button to re-set it and then add those shipping Rates Quote Best wishes Steve
Guest Posted June 5, 2003 Posted June 5, 2003 There are no SQL changes to run, you need to add those countries and rates to your zones shipping module in Admin>modules>shippingI would sugest you click the red button for zones in Admin>modules>shipping to de-activate that module then click the green button to re-set it and then add those shipping Rates Sorry, I was refering to the original UK postal rates contribution, not just this update. Installation 1. Create the database records 2. Place the .php & .jpg files in the correct directories. 3. Amend the Admin, Configuration, Shipping/Packaging 4. Update the Rates 1 and 2 using the files "Zones and Rates.txt" "Zones and Rates 2.txt" 5. Tweak and test :-) Part 1 is where I had the problem. :cry: Perhaps if you could talk me through that bit, step by tiny step, I can restore a backup of the database & try again? Quote
Guest Posted June 5, 2003 Posted June 5, 2003 you dont need to create any new tables for that module all the configuration is automatically inserted and deleted when you turn on/off the module. the file in the contribution isnt sql - its a summary of what he did - which is why it gave an sql error. use this function quote() { global $order, $shipping_quote_zones, $shipping_quote_all, $address_values, $shipping_weight, $shipping_quoted, $shipping_zones_cost, $shipping_zones_method; // if ( ($GLOBALS['shipping_quote_all'] == '1') || ($GLOBALS['shipping_quote_zones'] == '1') ) { if (1) { $shipping_quoted = 'zones'; $destination = tep_get_countries($address_values['country_id'], '1'); //$dest_country = $destination['countries_iso_code_2']; $dest_country = $order->delivery['country']['iso_code_2']; //echo $dest_country; $dest_zone = 0; for the start of the quote function in zones. I seem to remember having to monkey about with the file to get it to work for MS1 remember to switch it on and off when you swap the code Quote
Guest Posted June 5, 2003 Posted June 5, 2003 Hi Meltus, Thanks for your help so far. I guess that would explain why I had problems! :oops: I tried adding that code & now I get this error in the shipping admin: Parse error: parse error, unexpected T_IF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/bfnmama/public_html/catalog/includes/modules/shipping/zones.php on line 142 Line 142 ( if ($dest_zone == 0) { )is just after the code you posted - //echo $dest_country; $dest_zone = 0; break; } } if ($dest_zone == 0) { $shipping_zones_cost = 0; $shipping_zones_method = MODULE_SHIPPING_ZONES_INVALID_ZONE; return; } Quote
Guest Posted June 5, 2003 Posted June 5, 2003 apologies for posting such a big file: but this is the whole file <?php /* $Id: zones.php,v 1.11 2002/07/01 18:01:50 project3000 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License USAGE By default, the module comes with support for 1 zone. This can be easily changed by editing the line below in the zones constructor that defines $this->num_zones. Next, you will want to activate the module by going to the Admin screen, clicking on Modules, then clicking on Shipping. A list of all shipping modules should appear. Click on the green dot next to the one labeled zones.php. A list of settings will appear to the right. Click on the Edit button. PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD. Make sure you keep a backup of your shipping settings somewhere at all times. If you want an additional handling charge applied to orders that use this method, set the Handling Fee field. Next, you will need to define which countries are in each zone. Determining this might take some time and effort. You should group a set of countries that has similar shipping charges for the same weight. For instance, when shipping from the US, the countries of Japan, Australia, New Zealand, and Singapore have similar shipping rates. As an example, one of my customers is using this set of zones: 1: USA 2: Canada 3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland, Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain, Sweden, Switzerland, Finland, Portugal, Israel, Greece 4: Japan, Australia, New Zealand, Singapore 5: Taiwan, China, Hong Kong When you enter these country lists, enter them into the Zone X Countries fields, where "X" is the number of the zone. They should be entered as two character ISO country codes in all capital letters. They should be separated by commas with no spaces or other punctuation. For example: 1: US 2: CA 3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR 4: JP,AU,NZ,SG 5: TW,CN,HK Now you need to set up the shipping rate tables for each zone. Again, some time and effort will go into setting the appropriate rates. You will define a set of weight ranges and the shipping price for each range. For instance, you might want an order than weighs more than 0 and less than or equal to 3 to cost 5.50 to ship to a certain zone. This would be defined by this: 3:5.5 You should combine a bunch of these rates together in a comma delimited list and enter them into the "Zone X Shipping Table" fields where "X" is the zone number. For example, this might be used for Zone 1: 1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65, 12:19.1,13:20.55,14:22,15:23.45 The above example includes weights over 0 and up to 15. Note that units are not specified in this explanation since they should be specific to your locale. CAVEATS At this time, it does not deal with weights that are above the highest amount defined. This will probably be the next area to be improved with the module. For now, you could have one last very high range with a very high shipping rate to discourage orders of that magnitude. For instance: 999:1000 If you want to be able to ship to any country in the world, you will need to enter every country code into the Country fields. For most shops, you will not want to enter every country. This is often because of too much fraud from certain places. If a country is not listed, then the module will add a $0.00 shipping charge and will indicate that shipping is not available to that destination. PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED! It appears that the osC shipping system automatically rounds the shipping weight up to the nearest whole unit. This makes it more difficult to design precise shipping tables. If you want to, you can hack the shipping.php file to get rid of the rounding. Lastly, there is a limit of 255 characters on each of the Zone Shipping Tables and Zone Countries. */ class zones { var $code, $title, $description, $enabled, $num_zones; // class constructor function zones() { $this->code = 'zones'; $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE; $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION; $this->icon = DIR_WS_ICONS . 'postage-royal-mail.jpg'; $this->enabled = MODULE_SHIPPING_ZONES_STATUS; // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED $this->num_zones = 1; } // class methods function selection() { $selection_string = '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . "n" . ' <tr>' . "n" . ' <td class="main">' . (($this->icon) ? tep_image($this->icon, $this->title) : '') . ' ' . MODULE_SHIPPING_ZONES_TEXT_TITLE . '</td>' . "n" . ' <td align="right" class="main">' . tep_draw_checkbox_field('shipping_quote_zones', '1', true) . '</td>' . "n" . ' </tr>' . "n" . '</table>' . "n"; return $selection_string; } function quote() { global $order, $shipping_quote_zones, $shipping_quote_all, $address_values, $shipping_weight, $shipping_quoted, $shipping_zones_cost, $shipping_zones_method; // if ( ($GLOBALS['shipping_quote_all'] == '1') || ($GLOBALS['shipping_quote_zones'] == '1') ) { if (1) { $shipping_quoted = 'zones'; $destination = tep_get_countries($address_values['country_id'], '1'); //$dest_country = $destination['countries_iso_code_2']; $dest_country = $order->delivery['country']['iso_code_2']; //echo $dest_country; $dest_zone = 0; for ($i = 1; $i <= $this->num_zones; $i ++) { $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i); $country_zones = split("[,]", $countries_table); if ( in_array($dest_country, $country_zones ) ) { $dest_zone = $i; break; } } if ($dest_zone == 0) { $shipping_zones_cost = 0; $shipping_zones_method = MODULE_SHIPPING_ZONES_INVALID_ZONE; return; } $shipping = -1; $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $i); $zones_table = split("[:,]" , $zones_cost); for ($i = 0; $i < count($zones_table); $i+=2) { if ($shipping_weight <= $zones_table[$i]) { $shipping = $zones_table[$i+1]; $shipping_zones_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . " : " . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS; break; } } if ( $shipping == -1) { $shipping_zones_cost = 0; $shipping_zones_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE; } else { $shipping_zones_cost = ($shipping + MODULE_SHIPPING_ZONES_HANDLING + SHIPPING_HANDLING); } } return $this->quotes; } function cheapest() { global $shipping_count, $shipping_quote_zones, $shipping_quote_all, $shipping_cheapest, $shipping_cheapest_cost, $shipping_zones_cost; if ( ($shipping_quote_all == '1') || ($shipping_quote_zones) ) { if ($shipping_count == 0) { $shipping_cheapest = 'zones'; $shipping_cheapest_cost = $shipping_zones_cost; } else { if ($shipping_zones_cost < $shipping_cheapest_cost) { $shipping_cheapest = 'zones'; $shipping_cheapest_cost = $shipping_zones_cost; } } $shipping_count++; } } function display() { global $HTTP_GET_VARS, $currencies, $shipping_cheapest, $shipping_zones_method, $shipping_zones_cost, $shipping_selected; if (!$shipping_selected) $shipping_selected = $shipping_cheapest; if ( ($GLOBALS['shipping_quote_all'] == '1') || ($GLOBALS['shipping_quote_zones'] == '1') ) { $display_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "n" . ' <tr>' . "n" . ' <td class="main">' . (($this->icon) ? tep_image($this->icon, $this->title) : '') . ' ' . MODULE_SHIPPING_ZONES_TEXT_TITLE . ' <small><i>(' . $shipping_zones_method . ')</i></small></td>' . "n" . ' <td align="right" class="main">' . $currencies->format($shipping_zones_cost); if (tep_count_shipping_modules() > 1) { $display_string .= tep_draw_radio_field('shipping_selected', 'zones') . tep_draw_hidden_field('shipping_zones_cost', $shipping_zones_cost) . tep_draw_hidden_field('shipping_zones_method', $shipping_zones_method) . '</td>' . "n"; } else { $display_string .= tep_draw_hidden_field('shipping_selected', 'zones') . tep_draw_hidden_field('shipping_zones_cost', $shipping_zones_cost) . tep_draw_hidden_field('shipping_zones_method', $shipping_zones_method) . '</td>' . "n"; } $display_string .= ' </tr>' . "n" . '</table>' . "n"; } return $display_string; } function confirm() { global $HTTP_POST_VARS, $shipping_cost, $shipping_method, $shipping_selected; if ($shipping_selected == 'zones') { $shipping_cost = $HTTP_POST_VARS['shipping_zones_cost']; $shipping_method = $HTTP_POST_VARS['shipping_zones_method']; } } function check() { if (!isset($this->check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'"); $this->check = tep_db_num_rows($check_query); } return $this->check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', '1', 'Do you want to offer zone rate shipping?', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING', '0', 'Handling Fee for this shipping method', '6', '0', now())"); for ($i = 1; $i <= $this->num_zones; $i++) { $default_countries = ''; if ($i == 1) { $default_countries = 'US,CA'; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())"); } } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_HANDLING'"); for ($i = 1; $i <= $this->num_zones; $i ++) { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_COST_" . $i ."'"); } } function keys() { $keys = array('MODULE_SHIPPING_ZONES_STATUS', 'MODULE_SHIPPING_ZONES_HANDLING'); for ($i = 1; $i <= $this->num_zones; $i ++) { $keys[count($keys)] = 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i; $keys[count($keys)] = 'MODULE_SHIPPING_ZONES_COST_' . $i; } return $keys; } } ?> Quote
Guest Posted June 5, 2003 Posted June 5, 2003 Well that's got rid of the error. I can now get other shipping options to show if the UK standard shipping is turned off, but if I turn it on, nothing shows when I try to checkout. :? Quote
Guest Posted June 5, 2003 Posted June 5, 2003 ho hum, I do remember having some problems with these files - and to be honest I don't use them anymore - possibly because they were pulling my chain as well. I will send you my UK shipping modules in the morning if you leave your email in a PM. Quote
Guest Posted June 19, 2003 Posted June 19, 2003 Hi All, If you have had problems with the mod it may be that you are on a later snapshot than the mod was designed for. I had problems and contacted Phil (the almighty creator) who sent me two new files to replace 'zones.php' and 'zones2.php'. They now work fine. Phil's e-mail address is in the 'read-me' file in the contribution folder if you wish to contact him or if you want the files from me post a pm with your e-mail and I will send them to you. Note: I am not able to offer support for this mod, cos I don't av a brain... :? Quote
Guest Posted July 31, 2003 Posted July 31, 2003 I am having another problem which i know has been answered in the forums before but i cant find it with the useless search, and i think im getting too stressed and missing the bloody obvious with this problem. I have installed the contrib and it seems to be installed and everything fine, but it only shows zone1 details not 2,3 or 4. I know this is a simple thing to fix but i cant figure it out. please help Quote
Guest Posted July 31, 2003 Posted July 31, 2003 Just call me stoopid i got the error fixed!! I have a query with the original post though, i was just on the main Royal mail site, and the prices quoted on there are a lot cheaper than the prices in this thread. .10:0.41,.20:0.72 On the royal mail site first class post to the uk and europe is the following .10:0.38,.200.38 have i missed something here, most of the prices have only gone up by one or two pence on the original prices supplied by phil!! Quote
Guest Posted July 31, 2003 Posted July 31, 2003 incidently the link for the royal mail site can be found here http://www.royalmail.com/portal/default/al...equestid=103350 I must be missing something because even Phils prices in the contrib(unless they have been updated) start at 0.41p and i have the book he used sitting here in front of me and I cant find those prices!! Quote
Guest Posted August 10, 2003 Posted August 10, 2003 OK - I don't get these prices at all!! What unit are you using to measure weight? The first price of 28p for postage within the UK is up to 60g; the second is 42p up to 100g. This does not seem to correlate at all with what is in this thread. Can some enlighten me please. What unit do I need to use for measure when I weigh all my products and can someone explain how these prices were arrivced at? I am going to have to get cracking on it soonish so I would appreciate a little help. *waves to Lynda if she sees this* Quote
radders Posted August 10, 2003 Posted August 10, 2003 Just use kilos for the unit of weight. There is not enough space in the field for a very fine grid so it will overprice some intermediate weights. I did read in the contribution some time ago that you had to set the tare weight to zero. Bear in mind that when sending abroad the cost insurance starts at round about ?3.15. afaik I am just using the standard zones module for UK and overseas postage. It seems to work OK. Quote
Guest Posted August 10, 2003 Posted August 10, 2003 Thanks. I think it will still need updating though. There was a price increase not so long ago and I want to incorporate Parcel Force rates in it. But at least now I know what I'm changing. Quote
dcswiftly Posted August 11, 2003 Posted August 11, 2003 i am really interested, can i have the new shipping modules to. Quote i have made progress on computers over the last few years as a middle aged man, so please be patient if i do not grasp first time your advice.
Guest Posted August 17, 2003 Posted August 17, 2003 HELP!! I haven't changed anything on it yet and I did a test purchase of an item which weighs 15g (a mini pin). I HAVE entered the weight in the item description as 0.015 (kg) and yet when I try to buy it it tells me it weighs ?3.01 lbs (wrong unit) and wants to charge me ?18.09 for shipping - obviously WAYYYY too much! It should be ?1.41 with the postage and ?1 packaging/handling charge. I created 4 zones, entered the info given in the first post of this topic and that is all. Is there something else I should have done? Quote
Guest Posted August 17, 2003 Posted August 17, 2003 Try entering the weight in grams - using a weight <1 seems to send mine loopy. <waving back :lol: > Quote
Guest Posted August 17, 2003 Posted August 17, 2003 Yikes - tried that and it says it's 18 lbs and wants to charge me ?69.09 for postage!!!!! Don't think that worked somehow! :D Quote
Guest Posted August 17, 2003 Posted August 17, 2003 Did you remember to update the details in the postal rates section as well as change the weight of the product? Quote
Guest Posted August 17, 2003 Posted August 17, 2003 I was just thinking that also - if I change .10:0.41,.20:0.72,.30:0.96, etc to read: 100:0.41,200:0.72,300:0.96, etc then that should work shouldn't it? Quote
Guest Posted August 17, 2003 Posted August 17, 2003 OK - we're getting there. The postage rates are now right, whichi is the main thing, but it still says it weighs 18 lbs. Any idea how I can change that to say 15g or get rid of it completely? I would imagine there would be some kind of converter somewhere but I don't know where it's getting the 18 from. If it said 15 lbs that would make more sense, as then all I would need to do would be to change the lbs to grams. Quote
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.
Note: Your post will require moderator approval before it will be visible.