Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Different shipping rates based on zone?

    Hi,

    We use the table rate system to calculate shipping cost based on weight.

    We're based in the UK and would like to adjust the shipping cost depending upon a customer's location. We basically need one set of rates for shipping to mainland UK and another set for shipping to Scottish highlands and offshore islands.

    I haven't quite got my head around zones but would it be possible to set up certain UK counties to fall into one zone and other counties to fall into another zone (i.e. mainland UK counties as one zone and Scottish highlands and offshore islands as another zone). Could I then apply a set of shipping rates to each zone?

    I should add, the customer selects their country of residence and county from a drop down menu during registration. So can I use the data from these drop down menus to form the zone definitions?

    If not, is there another way I could solve this problem?

    If anyone could point me in the right direction it'd be much appreciated, thanks!

  2. #2
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    If you are doing business ONLY in the UK, you can completely re-structure the countries and zones data to a customized list.

    We needed to configure UK to comply with shipping rates for Royal Mail and Parcelforce24...

    We did this by:

    1. deleting ALL default countries and zones (so the database is EMPTY of countries)

    Then we set up a list of NEW "countries":

    • England
    • Wales
    • Scotland
    • Scottish Islands
    • Scottish Highlands
    • Isle of Man
    • Isle of Wight
    • Isles of Scilly
    • Channel Islands
    • Northern Ireland


    2. We "invented" the 2-digit and 3-digit ISO codes, as these do not exist in reality, but need to be in the ZC database.

    England: EN - - - ENG
    Wales: WS - - - WLS
    Scotland: SD - - - SLD
    Scottish Islands: SI - - - SIL
    Scottish Highlands: SH - - - SHL
    Isle of Man: IM - - - IMN
    Isle of Wight: IW - - - IWT
    Isles of Scilly: IS - - - ISC
    Channel Islands: CH - - - CHI
    Northern Ireland: NI - - - NIR

    3. We then applied the appropriate COUNTIES (zones) to the above "Countries", so, for example:

    Wales has the following zones (Counties):

    • Merthyr Tydfil
    • Caerphilly
    • Blaenau Gwent
    • Torfaen
    • Monmouthshire
    • Newport
    • Cardiff
    • Vale of Glamorgan
    • Bridgend
    • Rhondda Cynon Taf
    • Neath Port Talbot
    • Swansea
    • Carmarthenshire
    • Ceredigion
    • Powys
    • Wrexham
    • Flintshire
    • Denbighshire
    • Conwy
    • Gwynedd
    • Anglesey (Ynys Môn)
    • Pembrokeshire
    • Clwyd


    4. We then did the same for all the remaining "countries", remembering that (for example) the "country" Isle of Man, has justr ONE zone - also called "Isle of Man". Same for (countries) Scilly, Wight etc.

    But (country) Scottish Islands has these zones:

    • Orkney
    • Shetland
    • Hebrides
    • Bute


    ... and (country) Channel Islands has these zones:

    • Alderney
    • Guernsey
    • Jersey
    • Sark



    Do the same zone insertions for the remaining "countries",

    England
    Wales
    Scotland
    Northern Ireland


    5. Then you set the GEO ZONES - these are necessary to GROUP the countries and zones into shipping zones. For example, while ENGLAND, SCOTLAND and WALES are now all "countries" in their own right, they all form part of a larger group called UK MAINLAND (as these areas will all enjoy the same Royal Mail and Parcelforce24 rates)

    We set up FOUR Geo Zones:

    • UK MAINLAND
    • UK OFFSHORE
    • SCOTTISH HIGHLANDS
    • CHANNEL ISLANDS


    We now had the UK sorted into COUNTRIES, COUNTIES ZONES and SHIPPING ZONES.

    Here is the SQL code we ran in phpMyAdmin to effect all the above changes in one swoop!

    DO NOT RUN THIS QUERY ON A LIVE SHOP DATABASE. If you want to test it, then set up a TEST SHOP FIRST!

    I take no responsibility for crashing your live database!

    What you can do if phpMyAdmin scares you, is use this list (below) to see what COUNTIES apply to what COUNTRIES. Simply look at the Country ID (England for example is 244), then in the zones table, see what counties are listed against country code 244.

    Code:
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    --
    -- Table structure for table `countries`
    --
    
    DROP TABLE IF EXISTS `countries`;
    CREATE TABLE IF NOT EXISTS `countries` (
      `countries_id` int(11) NOT NULL auto_increment,
      `countries_name` varchar(64) NOT NULL default '',
      `countries_iso_code_2` char(2) NOT NULL default '',
      `countries_iso_code_3` char(3) NOT NULL default '',
      `address_format_id` int(11) NOT NULL default '0',
      PRIMARY KEY  (`countries_id`),
      KEY `idx_countries_name_zen` (`countries_name`),
      KEY `idx_address_format_id_zen` (`address_format_id`),
      KEY `idx_iso_2_zen` (`countries_iso_code_2`),
      KEY `idx_iso_3_zen` (`countries_iso_code_3`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=254 ;
    
    --
    -- Dumping data for table `countries`
    --
    
    INSERT INTO `countries` (`countries_id`, `countries_name`, `countries_iso_code_2`, `countries_iso_code_3`, `address_format_id`) VALUES
    (251, 'Scottish Islands', 'SI', 'SIL', 6),
    (250, 'Scottish Highlands', 'SH', 'SHL', 6),
    (241, 'Northern Ireland', 'NI', 'NIR', 6),
    (242, 'Scotland', 'SD', 'SLD', 6),
    (243, 'Wales', 'WS', 'WLS', 6),
    (244, 'England', 'EN', 'ENG', 6),
    (245, 'Isle Of Man', 'IM', 'IMN', 6),
    (246, 'Channel Islands', 'CH', 'CHI', 6),
    (253, 'Isle Of Wight', 'IW', 'IWT', 6),
    (252, 'Isles Of Scilly', 'IS', 'ISC', 6);
    
    
    --
    -- Table structure for table `geo_zones`
    --
    
    DROP TABLE IF EXISTS `geo_zones`;
    CREATE TABLE IF NOT EXISTS `geo_zones` (
      `geo_zone_id` int(11) NOT NULL auto_increment,
      `geo_zone_name` varchar(32) NOT NULL default '',
      `geo_zone_description` varchar(255) NOT NULL default '',
      `last_modified` datetime default NULL,
      `date_added` datetime NOT NULL default '0001-01-01 00:00:00',
      PRIMARY KEY  (`geo_zone_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
    
    --
    -- Dumping data for table `geo_zones`
    --
    
    INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES
    (3, 'Channel Islands', 'Channel Islands', NULL, '0001-01-01 00:00:00'),
    (2, 'UKMAIN', 'UK Mainland', 'NULL', '0001-01-01 00:00:00'),
    (4, 'UKOFFSHORE', 'UK Off-shore', NULL, '0001-01-01 00:00:00'),
    (6, 'Scottish Highlands', 'Scottish Highlands', NULL, '0001-01-01 00:00:00');
    
    
    --
    -- Table structure for table `zones`
    --
    
    DROP TABLE IF EXISTS `zones`;
    CREATE TABLE IF NOT EXISTS `zones` (
      `zone_id` int(11) NOT NULL auto_increment,
      `zone_country_id` int(11) NOT NULL default '0',
      `zone_code` varchar(32) NOT NULL default '',
      `zone_name` varchar(32) NOT NULL default '',
      PRIMARY KEY  (`zone_id`),
      KEY `idx_zone_country_id_zen` (`zone_country_id`),
      KEY `idx_zone_code_zen` (`zone_code`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=497 ;
    
    --
    -- Dumping data for table `zones`
    --
    
    INSERT INTO `zones` (`zone_id`, `zone_country_id`, `zone_code`, `zone_name`) VALUES
    (495, 252, 'Isles of Scilly', 'Isles of Scilly'),
    (494, 253, 'Isle of Wight', 'Isle of Wight'),
    (327, 241, 'Antrim', 'Antrim'),
    (328, 241, 'Armagh', 'Armagh'),
    (329, 241, 'Derry', 'Derry'),
    (330, 241, 'Down', 'Down'),
    (331, 241, 'Fermanagh', 'Fermanagh'),
    (332, 241, 'Londonderry', 'Londonderry'),
    (333, 241, 'Tyrone', 'Tyrone'),
    (334, 242, 'Aberdeenshire', 'Aberdeenshire'),
    (335, 242, 'Angus', 'Angus'),
    (336, 242, 'Argyll', 'Argyll'),
    (337, 242, 'Ayrshire', 'Ayrshire'),
    (338, 242, 'Banffshire', 'Banffshire'),
    (339, 242, 'Berwickshire', 'Berwickshire'),
    (340, 242, 'Borders', 'Borders'),
    (341, 251, 'Bute (islands of Arran and Bute)', 'Bute (islands of Arran and Bute)'),
    (342, 242, 'Caithness', 'Caithness'),
    (343, 242, 'Central', 'Central'),
    (344, 242, 'Clackmannanshire', 'Clackmannanshire'),
    (345, 242, 'Dumfriesshire', 'Dumfriesshire'),
    (346, 242, 'Dumfries and Galloway', 'Dumfries and Galloway'),
    (347, 242, 'Dunbartonshire', 'Dunbartonshire'),
    (348, 242, 'East Lothian', 'East Lothian'),
    (349, 242, 'Edinburgh', 'Edinburgh'),
    (350, 242, 'Elgin', 'Elgin'),
    (351, 242, 'Fife', 'Fife'),
    (352, 242, 'Forfarshire (see Angus)', 'Forfarshire (see Angus)'),
    (353, 242, 'Grampian', 'Grampian'),
    (354, 242, 'Haddington', 'Haddington'),
    (355, 250, 'Highland', 'Highland'),
    (356, 250, 'Inverness-shire', 'Inverness-shire'),
    (357, 242, 'Kincardineshire', 'Kincardineshire'),
    (358, 242, 'Kinross-shire', 'Kinross-shire'),
    (359, 242, 'Kirkcudbrightshire', 'Kirkcudbrightshire'),
    (360, 242, 'Lanarkshire', 'Lanarkshire'),
    (361, 242, 'Linlithgow', 'Linlithgow'),
    (362, 242, 'Lotian', 'Lotian'),
    (363, 242, 'Midlothian', 'Midlothian'),
    (364, 242, 'Moray', 'Moray'),
    (365, 242, 'Nairnshire', 'Nairnshire'),
    (366, 251, 'Orkney', 'Orkney'),
    (367, 242, 'Peeblesshire', 'Peeblesshire'),
    (368, 242, 'Pembrokeshire', 'Pembrokeshire'),
    (369, 242, 'Perth', 'Perth'),
    (370, 242, 'Perthshire', 'Perthshire'),
    (371, 242, 'Renfrewshire', 'Renfrewshire'),
    (372, 242, 'Ross & Cromarty (inc part of Lew', 'Ross & Cromarty (inc part of Lew'),
    (373, 242, 'Roxburghshire', 'Roxburghshire'),
    (374, 242, 'Selkirkshire', 'Selkirkshire'),
    (375, 251, 'Shetland', 'Shetland'),
    (376, 242, 'Stirlingshire', 'Stirlingshire'),
    (377, 242, 'Sutherland', 'Sutherland'),
    (378, 242, 'Tayside', 'Tayside'),
    (379, 242, 'West Lothian', 'West Lothian'),
    (496, 251, 'Hebrides', 'Hebrides'),
    (381, 242, 'Wigtownshire', 'Wigtownshire'),
    (382, 242, 'Zetland', 'Zetland'),
    (383, 243, 'Merthyr Tydfil ', 'Merthyr Tydfil '),
    (384, 243, 'Caerphilly ', 'Caerphilly '),
    (385, 243, 'Blaenau Gwent', 'Blaenau Gwent'),
    (386, 243, 'Torfaen', 'Torfaen'),
    (387, 243, 'Monmouthshire', 'Monmouthshire'),
    (388, 243, 'Newport', 'Newport'),
    (389, 243, 'Cardiff', 'Cardiff'),
    (390, 243, 'Vale of Glamorgan', 'Vale of Glamorgan'),
    (391, 243, 'Bridgend', 'Bridgend'),
    (392, 243, 'Rhondda Cynon Taf', 'Rhondda Cynon Taf'),
    (393, 243, 'Neath Port Talbot', 'Neath Port Talbot'),
    (394, 243, 'Swansea', 'Swansea'),
    (395, 243, 'Carmarthenshire', 'Carmarthenshire'),
    (396, 243, 'Ceredigion', 'Ceredigion'),
    (397, 243, 'Powys', 'Powys'),
    (398, 243, 'Wrexham', 'Wrexham'),
    (399, 243, 'Flintshire', 'Flintshire'),
    (400, 243, 'Denbighshire', 'Denbighshire'),
    (401, 243, 'Conwy', 'Conwy'),
    (402, 243, 'Gwynedd', 'Gwynedd'),
    (403, 243, 'Anglesey (Ynys Môn)', 'Anglesey (Ynys Môn)'),
    (404, 243, 'Pembrokeshire', 'Pembrokeshire'),
    (405, 243, 'Clwyd', 'Clwyd'),
    (406, 244, 'Avon', 'Avon'),
    (407, 244, 'Bedfordshire', 'Bedfordshire'),
    (408, 244, 'Berkshire', 'Berkshire'),
    (409, 244, 'Bristol', 'Bristol'),
    (410, 244, 'Buckinghamshire', 'Buckinghamshire'),
    (411, 244, 'Cambridgeshire', 'Cambridgeshire'),
    (412, 244, 'Cheshire', 'Cheshire'),
    (413, 244, 'Cleveland', 'Cleveland'),
    (414, 244, 'Cornwall', 'Cornwall'),
    (415, 244, 'Cumberland', 'Cumberland'),
    (416, 244, 'Cumbria', 'Cumbria'),
    (417, 244, 'Derbyshire', 'Derbyshire'),
    (418, 244, 'Devon', 'Devon'),
    (419, 244, 'Dorset', 'Dorset'),
    (420, 244, 'Durham', 'Durham'),
    (421, 244, 'Essex', 'Essex'),
    (422, 244, 'East Sussex', 'East Sussex'),
    (423, 244, 'East Yorkshire', 'East Yorkshire'),
    (424, 244, 'Gloucestershire', 'Gloucestershire'),
    (425, 244, 'Greater Manchester', 'Greater Manchester'),
    (426, 244, 'Hampshire', 'Hampshire'),
    (427, 244, 'Herefordshire', 'Herefordshire'),
    (428, 244, 'Hertfordshire', 'Hertfordshire'),
    (429, 244, 'Humberside', 'Humberside'),
    (430, 244, 'Huntingdonshire', 'Huntingdonshire'),
    (432, 244, 'Kent', 'Kent'),
    (433, 244, 'Lancashire', 'Lancashire'),
    (434, 244, 'Leicestershire', 'Leicestershire'),
    (435, 244, 'Lincolnshire', 'Lincolnshire'),
    (436, 244, 'London', 'London'),
    (437, 244, 'Middlesex', 'Middlesex'),
    (438, 244, 'Merseyside', 'Merseyside'),
    (439, 244, 'Norfolk', 'Norfolk'),
    (440, 244, 'Northamptonshire', 'Northamptonshire'),
    (441, 244, 'Northumberland', 'Northumberland'),
    (442, 244, 'North Yorkshire', 'North Yorkshire'),
    (443, 244, 'Nottinghamshire', 'Nottinghamshire'),
    (444, 244, 'Oxfordshire', 'Oxfordshire'),
    (445, 244, 'Rutland', 'Rutland'),
    (446, 244, 'Shropshire', 'Shropshire'),
    (447, 244, 'Somerset', 'Somerset'),
    (448, 244, 'South Yorkshire', 'South Yorkshire'),
    (449, 244, 'Staffordshire', 'Staffordshire'),
    (450, 244, 'Suffolk', 'Suffolk'),
    (451, 244, 'Surrey', 'Surrey'),
    (452, 244, 'Sussex', 'Sussex'),
    (453, 244, 'Tyne and Wear', 'Tyne and Wear'),
    (454, 244, 'Warwickshire', 'Warwickshire'),
    (455, 244, 'Westmorland', 'Westmorland'),
    (456, 244, 'West Midlands', 'West Midlands'),
    (457, 244, 'West Sussex', 'West Sussex'),
    (458, 244, 'West Yorkshire', 'West Yorkshire'),
    (459, 244, 'Wiltshire', 'Wiltshire'),
    (460, 244, 'Worcestershire', 'Worcestershire'),
    (461, 244, 'Yorkshire', 'Yorkshire'),
    (462, 246, 'Jersey', 'Jersey'),
    (463, 246, 'Guernsey', 'Guernsey'),
    (464, 246, 'Alderney', 'Alderney'),
    (465, 246, 'Sark', 'Sark'),
    (466, 246, 'Herm', 'Herm'),
    (467, 245, 'Isle of Man', 'Isle of Man'),
    
    --
    -- Table structure for table `zones_to_geo_zones`
    --
    
    DROP TABLE IF EXISTS `zones_to_geo_zones`;
    CREATE TABLE IF NOT EXISTS `zones_to_geo_zones` (
      `association_id` int(11) NOT NULL auto_increment,
      `zone_country_id` int(11) NOT NULL default '0',
      `zone_id` int(11) default NULL,
      `geo_zone_id` int(11) default NULL,
      `last_modified` datetime default NULL,
      `date_added` datetime NOT NULL default '0001-01-01 00:00:00',
      PRIMARY KEY  (`association_id`),
      KEY `idx_zones_zen` (`geo_zone_id`,`zone_country_id`,`zone_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
    
    --
    -- Dumping data for table `zones_to_geo_zones`
    --
    
    INSERT INTO `zones_to_geo_zones` (`association_id`, `zone_country_id`, `zone_id`, `geo_zone_id`, `last_modified`, `date_added`) VALUES
    (8, 246, 0, 3, NULL, '2009-01-01 10:50:00'),
    (11, 252, 0, 4, NULL, '2009-01-01 10:50:00'),
    (9, 245, 0, 4, NULL, '2009-01-01 10:50:00'),
    (4, 242, 0, 2, NULL, '2009-01-01 10:50:00'),
    (5, 243, 0, 2, NULL, '2009-01-01 10:50:00'),
    (6, 244, 0, 2, NULL, '2009-01-01 10:50:00'),
    (10, 253, 0, 4, NULL, '2009-01-01 10:50:00'),
    (12, 251, 0, 4, NULL, '2009-01-01 10:50:00'),
    (14, 250, 0, 6, NULL, '2009-01-01 10:50:00'),
    (15, 241, 0, 4, NULL, '2009-01-01 10:50:00');
    The next step was to create appropriate shipping modules to handle Royal Mail and / or Parcelforce24, so we CLONED the Table Rate module a few times so we could use it uniquely for each Geo Zone.

    This was a bit more complicated, and is another story, as we put some WEIGHT conditionals into the code to display EITHER Royal Mail OR Parcelforce, depending on whether the cart weight was over or under 2kg!

    To see the end result, visit

    www. edutrade . co . uk and put a few items in the shopping cart

    Then play around with quantities to add more weight (exceed 2kgs) to see how going over 2kgs disables royal mail and invokes parcelforce.

    Also, play around with the shipping destination on the estimator to see how different rates will be applied, depending on the ZONE / GEO ZONE.

  3. #3
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    Remember too, that you may have existing customers whose addresses are already in the database.

    As the database tables for address data cross references the zones and countries tables, if you make radical changes to these, you may (probably will) affect the structure of existing customer addresses.

    There's also your shop's zone ID to consider.

    Proceed with Caution...

    If you know your SQL, and your customer list is not that long, you can UPDATE the address tables to reflect the new ID's you are likely to apply when you change your countries and zones structure.

  4. #4
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    fairestcape,

    Just had a read through your post, this looks like EXACTLY what we're after, although we need to ship to Republic of Ireland too, but I can't see any problem factoring this in.

    I'll experiment with this when I get into the office tomorrow and let you know how it goes. Thanks for the info, very much appreciated

  5. #5
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    One question, how exactly do you clone the table rate module?

    is it just a case of duplicating and renaming the table.php file within includes/modules/shipping/ ?

  6. #6
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    The standard ZONES module, and the standard TABLERATE module are not suitable for the format I suggested in my initial post. We used and cloned a module called ZONETABLES (a nifty combo of the ZONES and the TABLES modules). Zonetables is available here:

    http://www.zen-cart.com/index.php?ma...roducts_id=695

    For cloning shipping, look at this thread below (where the example is the FLAT RATE module.) The principle will apply to several other shipping modules (but not all of them.)

    http://www.zen-cart.com/forum/showthread.php?t=115687

    I will post (see below later), some clear instructions on cloning the ZONETABLES module.


    Republic Of Ireland

    If you also ship to Republic of Ireland, then just leave that country in your existing database. (I think it's given the dbase ID number of 103 in a standard install).

  7. #7
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    Get a copy of ZONETABLES and unzip it into a folder on your hard drive.

    Then, (as per the directions for FLAT RATE cloning in the above thread link), make ANOTHER COPY.

    Here are the opening 80-odd lines of zonetable.php

    PHP Code:
    <?php
    /**
     * @package shippingMethod
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: zonetable.php 4184 2007-08-17 03:36:36Z surf7.net $
     */
    /**
     * Enter description here...
     *
     */
    class zonetable extends base {
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $code;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $title;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $description;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $icon;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $enabled;
      
    /**
       * Enter description here...
       *
       * @return zonetable
       */
      
    var $num_zones;
      
    /**
       * Enter description here...
       *
       * @return zonetable
       */
      
    var $dest_zone;
      
    /**
       * Enter description here...
       *
       * @return zonetable
       */
      
    function zonetable() {
        global 
    $order$db;

        
    // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
        
    $this->num_zones 6;

        
    $this->code 'zonetable';
        
    $this->title MODULE_SHIPPING_ZONETABLE_TEXT_TITLE;
        
    $this->description MODULE_SHIPPING_ZONETABLE_TEXT_DESCRIPTION;
        
    $this->sort_order MODULE_SHIPPING_ZONETABLE_SORT_ORDER;
        
    $this->icon '';
        
    $this->tax_class MODULE_SHIPPING_ZONETABLE_TAX_CLASS;
        
    $this->tax_basis MODULE_SHIPPING_ZONETABLE_TAX_BASIS;
        
    // disable only when entire cart is free shipping
        
    if (zen_get_shipping_enabled($this->code)) {
          
    $this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true false);
        }
    Now, change the second copy to zonetabletwo.php, and where you see:

    lowercase zonetable in the code, change it to zonetabletwo

    uppercase ZONETABLE_ , change to ZONETABLETWO_

    (I show just the opening 80 lines. You MUST change ALL instances of the above...)

    PHP Code:
    <?php
    /**
     * @package shippingMethod
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: zonetabletwo.php 4184 2007-08-17 03:36:36Z surf7.net $
     */
    /**
     * Enter description here...
     *
     */
    class zonetabletwo extends base {
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $code;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $title;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $description;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $icon;
      
    /**
       * Enter description here...
       *
       * @var unknown_type
       */
      
    var $enabled;
      
    /**
       * Enter description here...
       *
       * @return zonetabletwo
       */
      
    var $num_zones;
      
    /**
       * Enter description here...
       *
       * @return zonetabletwo
       */
      
    var $dest_zone;
      
    /**
       * Enter description here...
       *
       * @return zonetabletwo
       */
      
    function zonetabletwo() {
        global 
    $order$db;

        
    // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
        
    $this->num_zones 6;

        
    $this->code 'zonetabletwo';
        
    $this->title MODULE_SHIPPING_ZONETABLETWO_TEXT_TITLE;
        
    $this->description MODULE_SHIPPING_ZONETABLETWO_TEXT_DESCRIPTION;
        
    $this->sort_order MODULE_SHIPPING_ZONETABLETWO_SORT_ORDER;
        
    $this->icon '';
        
    $this->tax_class MODULE_SHIPPING_ZONETABLETWO_TAX_CLASS;
        
    $this->tax_basis MODULE_SHIPPING_ZONETABLETWO_TAX_BASIS;
        
    // disable only when entire cart is free shipping
        
    if (zen_get_shipping_enabled($this->code)) {
          
    $this->enabled = ((MODULE_SHIPPING_ZONETABLETWO_STATUS == 'True') ? true false);
        }
    NOTE ALSO that in line(s) 64 - 68, I have increased the number of zones from the default 3, to 6. You will need these extra zones, so change it to 6 in your copies as well.

    PHP Code:
        // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
        
    $this->num_zones 6
    To install the modules, see that thread on the FLAT RATE cloning.

  8. #8
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    Hi again,

    Thanks for all your help, I wouldn't have a clue where to start without this. I'm just sat in the office working through all your instructions now. Not run into any problems yet but noticed something you may want to correct in your own code if you haven't already spotted it!

    Your sql query is placing pembrokeshire in scotland, not wales!

    (368, 242, 'Pembrokeshire', 'Pembrokeshire'),

  9. #9
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    another one...

    (382, 242, 'Zetland', 'Zetland'),

    Old name for the Shetland isles I believe? Don't think it's classed as Scottish Lowlands.

  10. #10
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Different shipping rates based on zone?

    Probably are a couple of errors.

    These are not my lists (ie: I did not compile them) but gleaned from various other sources.

    If you see errors, then by all means correct them.

    The BIG problem with UK counties is that there is an "official" list, and then a whole load of "unofficial" lists.

    This has come about because of the inherent stubbornness and dogmatism of the British public. (Not a criticism - just an observation ) Officialdom will join counties together, split counties up, etc, over the course of time, but local people will INSIST on keeping the traditional or locally popular name.

    EG: there is NO SUCH COUNTY as "South Gloucestershire", but some customers call up and say "I live in South Gloucestershire, but you don't have it on your Counties List... WHY NOT!!! ?"

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. How do I set 2 flat shipping rates to 2 different zone?
    By Klemens in forum Built-in Shipping and Payment Modules
    Replies: 88
    Last Post: 18 Nov 2010, 03:36 AM
  2. Cloning the Zone Based Rates Shipping Module?
    By pe7er in forum Addon Shipping Modules
    Replies: 15
    Last Post: 11 Mar 2010, 01:23 PM
  3. Zone rates based on different cities and not countries?
    By Kruna in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 14 Sep 2006, 01:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg