Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    1
    Plugin Contributions
    0

    Default Change iso-code-2 to country name

    I have searched and searched for the answer to this one but havnt been able to find the answer anywhere.

    Its a very simple question, how do I change the iso-code-2 display on the zones shipping, during checkout. Instead of it saying

    Shipping to AK (1 x 3.00kg(s))
    I want it to say
    Shipping to Auckland (1 x 3.00kg(s))


    Ive looked at the zones.php and can find where it says the following

    // class methods
    function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;
    $dest_country = $order->delivery['country']['iso_code_2'];
    $dest_zone = 0;
    $error = false;

    I assumed that if I changed the iso_code_2 to say name that would do the job but it doesnt.

    Any clues??

  2. #2
    Join Date
    Feb 2008
    Location
    Poland
    Posts
    11
    Plugin Contributions
    1

    Default Re: Change iso-code-2 to country name

    I'm surprised nobody responded to this earlier. Technically, if you do not use "Zone Rates" shipping (maybe others) you could change it to 'title'; but, that is an aweful hack. A better way to do it would be to create another variable and display that. I am using ZC version 1.3.8.

    Hacking a core file, or "How can I make upgrading harder?"

    [FONT="Courier New"]includes/modules/shipping/zones.php[/FONT]

    around line 118:

    PHP Code:
    function quote($method '') {
      global 
    $order$shipping_weight$shipping_num_boxes$total_count;

      
    $dest_country $order->delivery['country']['iso_code_2'];
      
    // add the next line
      
    $dest_country_name = (($dest_title =$order->delivery['country']['title']) == '' $dest_country $dest_title);

      
    $dest_zone 0;
      
    $error false
    Then change $dest_country to $dest_country_name in three places in the same file.

    around line 174:

    PHP Code:
    $shipping_method MODULE_SHIPPING_ZONES_TEXT_WAY ' ' $dest_country_name $show_box_weight// change this line
    $done true
    around line 188:

    PHP Code:
    if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= $zones_table[$i]) {
      
    $shipping $zones_table[$i+1];
      
    $shipping_method MODULE_SHIPPING_ZONES_TEXT_WAY ' ' $dest_country_name// change this line 
    around line 202:

    PHP Code:
    if (($total_count $_SESSION['cart']->free_shipping_items()) <= $zones_table[$i]) {
      
    $shipping $zones_table[$i+1];
      
    $shipping_method MODULE_SHIPPING_ZONES_TEXT_WAY ' ' $dest_country_name// change this line
      
    $done true

  3. #3
    Join Date
    Sep 2005
    Posts
    912
    Plugin Contributions
    1

    Default Re: Change iso-code-2 to country name

    tried that it didnt work

  4. #4
    Join Date
    Feb 2008
    Location
    Poland
    Posts
    11
    Plugin Contributions
    1

    Default Re: Change iso-code-2 to country name

    A little more detail would be helpful to solve your problem. Try reverting all your changes (back to the way it was originally) and try the following: (hopefully you have a development server to try this on!)

    [FONT="Courier New"]includes/modules/shipping/zones.php[/FONT]

    change this line:

    PHP Code:
      $dest_country $order->delivery['country']['iso_code_2']; 
    to this:

    PHP Code:
      $dest_country $order->delivery['country']['title']; 
    What does that look like? Note: this will screw up the shipping charges calculation, but should display the country name.

 

 

Similar Threads

  1. v153 Change ISO Code to Country Name on Zone Rate Shipping
    By Nick1973 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 6 Nov 2014, 12:53 AM
  2. v139h How to change from-code ISO-8859-1 to-code=UTF-8?
    By lina0962 in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 28 Oct 2014, 08:00 PM
  3. Zone Rates using Zone Code & Country ISO Codes?
    By dcmall in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 8 Aug 2007, 09:08 AM
  4. Passing ISO Country Code, Not Short Name
    By nicoled in forum General Questions
    Replies: 0
    Last Post: 23 Apr 2007, 05:54 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