Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default How can I Remove Counties from Drop Down List?

    This is the SQL patch I've used in an attempt to bring the UK counties up to date. I'm still missing some but I've made the mistake of adding DERRY and LONDONDERRY which are just different names for the same county. What would be the SQL patch to remove a particular coutny?

    PHP Code:
    DROP TABLE IF EXISTS zones;
    CREATE TABLE zones (
      
    zone_id int(11NOT NULL auto_increment,
      
    zone_country_id int(11NOT NULL default '0',
      
    zone_code varchar(32NOT NULL default '',
      
    zone_name varchar(32NOT NULL default '',
      
    PRIMARY KEY  (zone_id),
      
    KEY idx_zone_country_id_zen (zone_country_id),
      
    KEY idx_zone_code_zen (zone_code)
    TYPE=MyISAM;
    INSERT INTO zones VALUES (NULL222'Aberdeenshire''Aberdeenshire');
    INSERT INTO zones VALUES (NULL222'Anglesey''Anglesey');
    INSERT INTO zones VALUES (NULL222'Angus''Angus');
    INSERT INTO zones VALUES (NULL222'Argyll''Argyll');
    INSERT INTO zones VALUES (NULL222'Avon''Avon');
    INSERT INTO zones VALUES (NULL222'Ayrshire''Ayrshire');
    INSERT INTO zones VALUES (NULL222'Banffshire''Banffshire');
    INSERT INTO zones VALUES (NULL222'Bedfordshire''Bedfordshire');
    INSERT INTO zones VALUES (NULL222'Berkshire''Berkshire');
    INSERT INTO zones VALUES (NULL222'Berwickshire''Berwickshire');
    INSERT INTO zones VALUES (NULL222'Borders''Borders');
    INSERT INTO zones VALUES (NULL222'Breconshire''Breconshire');
    INSERT INTO zones VALUES (NULL222'Buckinghamshire''Buckinghamshire');
    INSERT INTO zones VALUES (NULL222'Bute''Bute');
    INSERT INTO zones VALUES (NULL222'Caernarvonshire''Caernarvonshire');
    INSERT INTO zones VALUES (NULL222'Caithness''Caithness');
    INSERT INTO zones VALUES (NULL222'Cardiganshire''Cardiganshire');
    INSERT INTO zones VALUES (NULL222'Carmarthenshire''Carmarthenshire');
    INSERT INTO zones VALUES (NULL222'Cambridgeshire''Cambridgeshire');
    INSERT INTO zones VALUES (NULL222'Central''Central');
    INSERT INTO zones VALUES (NULL222'Cheshire''Cheshire');
    INSERT INTO zones VALUES (NULL222'Clackmannanshire''Clackmannanshire');
    INSERT INTO zones VALUES (NULL222'Cleveland''Cleveland');
    INSERT INTO zones VALUES (NULL222'Clwyd''Clwyd');
    INSERT INTO zones VALUES (NULL222'Conwy''Conwy');
    INSERT INTO zones VALUES (NULL222'Cornwall''Cornwall');
    INSERT INTO zones VALUES (NULL222'County Antrim''County Antrim');
    INSERT INTO zones VALUES (NULL222'County Armagh''County Armagh');
    INSERT INTO zones VALUES (NULL222'County Down''County Down');
    INSERT INTO zones VALUES (NULL222'County Fermanagh''County Fermanagh');
    INSERT INTO zones VALUES (NULL222'County Tyrone''County Tyrone');
    INSERT INTO zones VALUES (NULL222'Cumbria''Cumbria');
    INSERT INTO zones VALUES (NULL222'Denbighshire''Denbighshire');
    INSERT INTO zones VALUES (NULL222'Derbyshire''Derbyshire');
    INSERT INTO zones VALUES (NULL222'Derry''Derry');
    INSERT INTO zones VALUES (NULL222'Devon''Devon');
    INSERT INTO zones VALUES (NULL222'Dorset''Dorset');
    INSERT INTO zones VALUES (NULL222'Dumfries and Galloway''Dumfries and Galloway');
    INSERT INTO zones VALUES (NULL222'Dumfriesshire''Dumfriesshire');
    INSERT INTO zones VALUES (NULL222'Durham''Durham');
    INSERT INTO zones VALUES (NULL222'Dyfed''Dyfed');
    INSERT INTO zones VALUES (NULL222'East Lothian''East Lothian');
    INSERT INTO zones VALUES (NULL222'East Sussex''East Sussex');
    INSERT INTO zones VALUES (NULL222'Essex''Essex');
    INSERT INTO zones VALUES (NULL222'Fife''Fife');
    INSERT INTO zones VALUES (NULL222'Flintshire''Flintshire');
    INSERT INTO zones VALUES (NULL222'Glamorgan''Glamorgan');
    INSERT INTO zones VALUES (NULL222'Gloucestershire''Gloucestershire');
    INSERT INTO zones VALUES (NULL222'Grampian''Grampian');
    INSERT INTO zones VALUES (NULL222'Greater London''Greater London');
    INSERT INTO zones VALUES (NULL222'Greater Manchester''Greater Manchester');
    INSERT INTO zones VALUES (NULL222'Guernsey''Guernsey');
    INSERT INTO zones VALUES (NULL222'Gwent''Gwent');
    INSERT INTO zones VALUES (NULL222'Gwynedd County''Gwynedd County');
    INSERT INTO zones VALUES (NULL222'Hampshire''Hampshire');
    INSERT INTO zones VALUES (NULL222'Herefordshire''Herefordshire');
    INSERT INTO zones VALUES (NULL222'Hertfordshire''Hertfordshire');
    INSERT INTO zones VALUES (NULL222'Highlands and Islands''Highlands and Islands');
    INSERT INTO zones VALUES (NULL222'Humberside''Humberside');
    INSERT INTO zones VALUES (NULL222'Inverness''Inverness');
    INSERT INTO zones VALUES (NULL222'Isle of Man''Isle of Man');
    INSERT INTO zones VALUES (NULL222'Isle of Wight''Isle of Wight');
    INSERT INTO zones VALUES (NULL222'Jersey''Jersey');
    INSERT INTO zones VALUES (NULL222'Kent''Kent');
    INSERT INTO zones VALUES (NULL222'Kincardineshire''Kincardineshire');
    INSERT INTO zones VALUES (NULL222'Kinross-shire''Kinross-shire');
    INSERT INTO zones VALUES (NULL222'Kirkcudbrightshire''Kirkcudbrightshire');
    INSERT INTO zones VALUES (NULL222'Lanarkshire''Lanarkshire');
    INSERT INTO zones VALUES (NULL222'Lancashire''Lancashire');
    INSERT INTO zones VALUES (NULL222'Leicestershire''Leicestershire');
    INSERT INTO zones VALUES (NULL222'Lincolnshire''Lincolnshire');
    INSERT INTO zones VALUES (NULL222'London''London');
    INSERT INTO zones VALUES (NULL222'Londonderry''Londonderry');
    INSERT INTO zones VALUES (NULL222'Lothians''Lothians');
    INSERT INTO zones VALUES (NULL222'Midlothian''Midlothian');
    INSERT INTO zones VALUES (NULL222'Monmouthshire''Monmouthshire');
    INSERT INTO zones VALUES (NULL222'Montgomeryshire''Montgomeryshire');
    INSERT INTO zones VALUES (NULL222'Merionethshire''Merionethshire');
    INSERT INTO zones VALUES (NULL222'Merseyside''Merseyside');
    INSERT INTO zones VALUES (NULL222'Mid Glamorgan''Mid Glamorgan');
    INSERT INTO zones VALUES (NULL222'Moray''Moray');
    INSERT INTO zones VALUES (NULL222'Nairnshire''Nairnshire');
    INSERT INTO zones VALUES (NULL222'Norfolk''Norfolk');
    INSERT INTO zones VALUES (NULL222'North Yorkshire''North Yorkshire');
    INSERT INTO zones VALUES (NULL222'Northamptonshire''Northamptonshire');
    INSERT INTO zones VALUES (NULL222'Northumberland''Northumberland');
    INSERT INTO zones VALUES (NULL222'Nottinghamshire''Nottinghamshire');
    INSERT INTO zones VALUES (NULL222'Orkney''Orkney');
    INSERT INTO zones VALUES (NULL222'Oxfordshire''Oxfordshire');
    INSERT INTO zones VALUES (NULL222'Peebleshire''Peebleshire');
    INSERT INTO zones VALUES (NULL222'Perthshire''Perthshire');
    INSERT INTO zones VALUES (NULL222'Powys''Powys');
    INSERT INTO zones VALUES (NULL222'Pembrokeshire''Pembrokeshire');
    INSERT INTO zones VALUES (NULL222'Radnorshire''Radnorshire');
    INSERT INTO zones VALUES (NULL222'Renfrewshire''Renfrewshire');
    INSERT INTO zones VALUES (NULL222'Ross & Cromarty''Ross & Cromarty');
    INSERT INTO zones VALUES (NULL222'Roxburghshire''Roxburghshire');
    INSERT INTO zones VALUES (NULL222'Rutland''Rutland');
    INSERT INTO zones VALUES (NULL222'Selkirkshire''Selkirkshire');
    INSERT INTO zones VALUES (NULL222'Shetland''Shetland');
    INSERT INTO zones VALUES (NULL222'Shropshire''Shropshire');
    INSERT INTO zones VALUES (NULL222'Somerset''Somerset');
    INSERT INTO zones VALUES (NULL222'South Glamorgan''South Glamorgan');
    INSERT INTO zones VALUES (NULL222'South Yorkshire''South Yorkshire');
    INSERT INTO zones VALUES (NULL222'Staffordshire''Staffordshire');
    INSERT INTO zones VALUES (NULL222'Strathclyde''Strathclyde');
    INSERT INTO zones VALUES (NULL222'Stirlingshire''Stirlingshire');
    INSERT INTO zones VALUES (NULL222'Sutherland''Sutherland');
    INSERT INTO zones VALUES (NULL222'Suffolk''Suffolk');
    INSERT INTO zones VALUES (NULL222'Surrey''Surrey');
    INSERT INTO zones VALUES (NULL222'Tayside''Tayside');
    INSERT INTO zones VALUES (NULL222'Tyne and Wear''Tyne and Wear');
    INSERT INTO zones VALUES (NULL222'Warwickshire''Warwickshire');
    INSERT INTO zones VALUES (NULL222'West Dumbartonshire''East Dumbartonshire');
    INSERT INTO zones VALUES (NULL222'West Glamorgan''West Glamorgan');
    INSERT INTO zones VALUES (NULL222'West Lothian''West Lothian');
    INSERT INTO zones VALUES (NULL222'West Midlands''West Midlands');
    INSERT INTO zones VALUES (NULL222'West Sussex''West Sussex');
    INSERT INTO zones VALUES (NULL222'West Yorkshire''West Yorkshire');
    INSERT INTO zones VALUES (NULL222'Wigtownshire''Wigtownshire');
    INSERT INTO zones VALUES (NULL222'Wiltshire''Wiltshire');
    INSERT INTO zones VALUES (NULL222'Worcestershire''Worcestershire'); 
    Better still, doesn anyone have a link to an SQL patch that would give a county drop down that's seperated by ENGLAND, SCOTLAND, IRELAND, WALES sub headings within the list, like the one eBay uses?

  2. #2
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How can I Remove Counties from Drop Down List?

    Basically, what would the SQL syntax be to remove this:

    PHP Code:
    DROP TABLE IF EXISTS zones;
    CREATE TABLE zones (
      
    zone_id int(11NOT NULL auto_increment,
      
    zone_country_id int(11NOT NULL default '0',
      
    zone_code varchar(32NOT NULL default '',
      
    zone_name varchar(32NOT NULL default '',
      
    PRIMARY KEY  (zone_id),
      
    KEY idx_zone_country_id_zen (zone_country_id),
      
    KEY idx_zone_code_zen (zone_code)
    TYPE=MyISAM;
    INSERT INTO zones VALUES (NULL222'Aberdeenshire''Aberdeenshire'); 
    Anyone?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How can I Remove Counties from Drop Down List?

    You are in dangerous territory here.

    Dropping and rebuilding the table with different data all the time is fraught with cascading side effects, including potentially rendering all your existing customers' and orders' address data invalid or pointing to different places. Do you really want to run the risk of having customers who live in London suddenly having their addresses point them to living in Liverpool?

    The zone_id assigned when loading those records is used relationally by other tables which use the data. So ... quite simply ... DO NOT blindly drop and rebuild tables with different data than they originally contained.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How can I Remove Counties from Drop Down List?

    Good advice, I didn't think of that. Is it do-able though? If so then I'll just post a job on the freelancer site I use as there are a couple of good ZC pro's on there who've been very helpful in the past.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How can I Remove Counties from Drop Down List?

    So, it's "good advice" to not do it but you intend to "do it anyway"?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How can I Remove Counties from Drop Down List?

    Well, not exactly. I'd get a pro to do it rather than doing it myself. Surely a pro could do it?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How can I Remove Counties from Drop Down List?

    Quote Originally Posted by limelites View Post
    Basically, what would the SQL syntax be to remove this:

    PHP Code:
    DROP TABLE IF EXISTS zones;
    CREATE TABLE zones (
      
    zone_id int(11NOT NULL auto_increment,
      
    zone_country_id int(11NOT NULL default '0',
      
    zone_code varchar(32NOT NULL default '',
      
    zone_name varchar(32NOT NULL default '',
      
    PRIMARY KEY  (zone_id),
      
    KEY idx_zone_country_id_zen (zone_country_id),
      
    KEY idx_zone_code_zen (zone_code)
    TYPE=MyISAM;
    INSERT INTO zones VALUES (NULL222'Aberdeenshire''Aberdeenshire'); 
    Anyone?
    No SQL required. Just go to Admin->Locations/Taxes->Zones, find the one you want to delete, and delete it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: How can I Remove Counties from Drop Down List?

    Seems over complex. I'll leave it as it. Thanks for the admin link, never used that before but very uesful for deleting obsolete counties and even adding missing ones.

 

 

Similar Threads

  1. Can't choose a Zone from the drop down list
    By ssailer in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 23 Nov 2011, 06:18 PM
  2. Can I remove the Option text from in front of a drop down box?
    By dandandanpie in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Oct 2011, 08:40 PM
  3. How to remove currency drop-down menu from header?
    By Tamuren in forum Basic Configuration
    Replies: 7
    Last Post: 10 May 2011, 06:41 PM
  4. Replies: 2
    Last Post: 6 Jul 2010, 08:56 PM
  5. Remove Drop Down Currency List
    By anakeimai in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Aug 2009, 03:03 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