Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    114
    Plugin Contributions
    0

    Default Would like Country names on Checking not ISO 2 digit

    Hi all

    I have set up the zone module to calculate shipping based on the country, so far so good.

    However, the zone rate is labeled, for example:

    Shipping to GB
    Is there a way I can set it up so it uses the Country name rather than its ISO code? I have searched and tried a method, but it didn't work.

    Any help gratefully received.
    Debbie Harrison
    DVH Design | Web Design blog

  2. #2
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Re: Would like Country names on Checking not ISO 2 digit

    Debbie

    did you manage to get this working?

    I'm assuming the $dest_country needs to be changed in the following line:

    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;

    Not sure what to though!

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,725
    Plugin Contributions
    6

    Default Re: Would like Country names on Checking not ISO 2 digit

    You would need to customize the Zone Rates zones shipping module in:
    /includes/modules/shipping/zones.php

    adding the code in RED:
    Code:
    // class methods
        function quote($method = '') {
          global $order, $shipping_weight, $shipping_num_boxes, $total_count;
          $dest_country = $order->delivery['country']['iso_code_2'];
    // bof: get country's name
          global $db;
          $dest_country_name_raw = $db->Execute("SELECT countries_name FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $dest_country . "'");
          $dest_country_name = $dest_country_name_raw->fields['countries_name'];
    // eof: get country's name
          $dest_zone = 0;
          $error = false;
    Then changing the lines to use the $dest_country_name:
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name . $show_box_weight;
    // eof: use country's name
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  4. #4
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Re: Would like Country names on Checking not ISO 2 digit

    Thank you.

    All working fine. Not that I ever doubted it would't unless I messed up the cut and paste.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,725
    Plugin Contributions
    6

    Default Re: Would like Country names on Checking not ISO 2 digit

    Thanks for the update that this is working for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  6. #6
    Join Date
    Mar 2012
    Location
    Singapore
    Posts
    17
    Plugin Contributions
    0

    Default Re: Would like Country names on Checking not ISO 2 digit

    Quote Originally Posted by Ajeh View Post
    You would need to customize the Zone Rates zones shipping module in:
    /includes/modules/shipping/zones.php

    adding the code in RED:
    Code:
    // class methods
        function quote($method = '') {
          global $order, $shipping_weight, $shipping_num_boxes, $total_count;
          $dest_country = $order->delivery['country']['iso_code_2'];
    // bof: get country's name
          global $db;
          $dest_country_name_raw = $db->Execute("SELECT countries_name FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $dest_country . "'");
          $dest_country_name = $dest_country_name_raw->fields['countries_name'];
    // eof: get country's name
          $dest_zone = 0;
          $error = false;
    Then changing the lines to use the $dest_country_name:
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name . $show_box_weight;
    // eof: use country's name
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    Hi,

    I would like to display country name during checkout also. I am now using V1.5.0 but I can find the first and the last part of the scripts needed to be changed, but couldn't find the 2nd and 3rd one you highlighted in red.
    Can show me where to insert?

    https://www.dropbox.com/s/6oeyfwindnatcub/zones.php

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,725
    Plugin Contributions
    6

    Default Re: Would like Country names on Checking not ISO 2 digit

    The original line reads:
    Code:
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
    You need to change it to the new line with the variable in RED ...
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    If you still want the $show_box_weight, then use:
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name . $show_box_weight;
    // eof: use country's name
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  8. #8
    Join Date
    Mar 2012
    Location
    Singapore
    Posts
    17
    Plugin Contributions
    0

    Default Re: Would like Country names on Checking not ISO 2 digit

    Quote Originally Posted by Ajeh View Post
    The original line reads:
    Code:
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
    You need to change it to the new line with the variable in RED ...
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name;
    // eof: use country's name
    If you still want the $show_box_weight, then use:
    Code:
    // bof: use country's name
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country_name . $show_box_weight;
    // eof: use country's name
    Hi Linda,

    Sorry for the late reply due to my short break. Thank you so much for your help. It is working fine now!

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,725
    Plugin Contributions
    6

    Default Re: Would like Country names on Checking not ISO 2 digit

    Thanks for the update that this is now working for you properly ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 

Similar Threads

  1. 3 digit country ISO codes
    By damiantaylor in forum General Questions
    Replies: 3
    Last Post: 14 Aug 2010, 10:25 AM
  2. Country names instead of iso codes
    By dartmoorcf in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 26 May 2010, 10:58 AM
  3. ISO Country Codes
    By hales in forum Managing Customers and Orders
    Replies: 2
    Last Post: 10 Aug 2008, 10:08 PM
  4. Passing ISO Country Code, Not Short Name
    By nicoled in forum General Questions
    Replies: 0
    Last Post: 23 Apr 2007, 05:54 PM

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
  •