Results 1 to 5 of 5
  1. #1

    Idea or Suggestion Setting up Zone Definitions

    Hi Everyone,

    just wanted to share a bit of SQL with anyone who wants to setup zones definitions...

    I needed a zone that included the whole world except those countries already listed in other zone definitions. This is of course a pain in the ...

    So I did this:

    Find the geo_zone_id of the zone definition. In my case 10.

    insert all countries into it:
    Code:
    INSERT INTO `zenc_zones_to_geo_zones` (zone_country_id,geo_zone_id,zone_id,date_added) SELECT countries_id,10,0,now() FROM zenc_countries
    Now remove all the countries that are already in use:
    Code:
    delete from `zenc_zones_to_geo_zones` t1,`zenc_zones_to_geo_zones` t2
    where t1.geo_zone_id=10
    and t1.zone_country_id = t2.zone_country_id
    and t2.geo_zone_id!=10
    And you are done!

    Quite easy really, but it took me some tinkering before getting it right.

    And oh yeah, don't forget to backup your tables before doing this!!!

  2. #2
    Join Date
    Oct 2008
    Posts
    16
    Plugin Contributions
    0

    Default Re: Setting up Zone Definitions

    This was just what I was looking for, however there was a small amend needed in the sql to actually delete the duplicate rows , as below in bold;

    Code:
    delete t1 from `zen_zones_to_geo_zones` t1, `zen_zones_to_geo_zones` t2
    Many thanks Jabbah

  3. #3

    Default Re: Setting up Zone Definitions

    You are welcome!

    I am happy it was usefull to someone.

  4. #4
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: Setting up Zone Definitions

    Could you explain how to do this? Is it via phpmyadmin?

    Thanks a million!

  5. #5

    Default Re: Setting up Zone Definitions

    Yes this can be done with phpMyAdmin, but I think if you are asking this question this code is not for you (no offence). You must be sure about what you are doing to use his.
    If you want to give it a go, MAKE A BACKUP OF YOUR DATABASE FIRST!

    Good luck!

 

 

Similar Threads

  1. v154 Setting up zones, zone definitions, taxes, and shipping options
    By david0729 in forum General Questions
    Replies: 4
    Last Post: 13 Jan 2016, 11:40 PM
  2. Zone Definitions HELP!!
    By ryan11 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 30 Oct 2010, 02:16 AM
  3. What's the difference between Zone Definitions and Zone Rate Shipping?
    By Sevenhelmets in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 30 Nov 2009, 05:25 PM
  4. Custom Zone Definitions, ISO Code, and the Zone Rate Module
    By coffeefan in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 16 Jul 2009, 10:47 PM
  5. Tax Zone Definitions
    By proproductsandmore in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 5 Dec 2007, 02:08 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR