Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    39
    Plugin Contributions
    0

    Default How to limit the number of countries from the shipping estimator page?

    I thought I'd share this one to everyone. From the shipping estimator page, I only wanted to display the U.S. and Canada as selections. I accomplished this by editting includes/functions/functions_lookups.php.

    After line 46, I added the line
    PHP Code:
    where (countries_id 223 || countries_id 38
    ORIGINAL PHP CODE:
    PHP Code:
        if (zen_not_null($countries_id)) {
          if (
    $with_iso_codes == true) {
            
    $countries "select countries_name, countries_iso_code_2, countries_iso_code_3
                          from " 
    TABLE_COUNTRIES "
                          where countries_id = '" 
    . (int)$countries_id "'
                          order by countries_name"
    ;
            
    $countries_values $db->Execute($countries);
            
    $countries_array = array('countries_name' => $countries_values->fields['countries_name'],
                                     
    'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'],
                                     
    'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']);
          } else {
            
    $countries "select countries_name
                          from " 
    TABLE_COUNTRIES "
                          where countries_id = '" 
    . (int)$countries_id "'";
            
    $countries_values $db->Execute($countries);
            
    $countries_array = array('countries_name' => $countries_values->fields['countries_name']);
          }
        } else {
          
    $countries "select countries_id, countries_name
                        from " 
    TABLE_COUNTRIES "
                        order by countries_name"


    PHP CODE AFTER EDIT:
    PHP Code:
        if (zen_not_null($countries_id)) {
          if (
    $with_iso_codes == true) {
            
    $countries "select countries_name, countries_iso_code_2, countries_iso_code_3
                          from " 
    TABLE_COUNTRIES "
                          where countries_id = '" 
    . (int)$countries_id "'
                          order by countries_name"
    ;
            
    $countries_values $db->Execute($countries);
            
    $countries_array = array('countries_name' => $countries_values->fields['countries_name'],
                                     
    'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'],
                                     
    'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']);
          } else {
            
    $countries "select countries_name
                          from " 
    TABLE_COUNTRIES "
                          where countries_id = '" 
    . (int)$countries_id "'";
            
    $countries_values $db->Execute($countries);
            
    $countries_array = array('countries_name' => $countries_values->fields['countries_name']);
          }
        } else {
          
    $countries "select countries_id, countries_name
                        from " 
    TABLE_COUNTRIES "
         where (countries_id = 223 || countries_id = 38)
                        order by countries_name"


    Cheers!
    -----------------------------------------------------------------------
    Do you Gogo?

  2. #2
    Join Date
    Apr 2008
    Location
    Boston
    Posts
    148
    Plugin Contributions
    0

    Default Re: How to limit the number of countries from the shipping estimator page

    Thank you, I had been searching but skipped this post a few times because there where no replies.
    This worked perfectly.

 

 

Similar Threads

  1. v150 How to call the shipping estimator pop-up from within product info page?
    By Athens Collectibles in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 May 2012, 09:44 AM
  2. Has anyone ever figured out how to limit the number of subcategories per page.
    By member in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 25 Jun 2008, 09:30 PM
  3. How can I put back the countries I deleted from the database?
    By whitknits in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 20 Dec 2007, 03:54 PM
  4. Hi ! How can i limit the number of category or product to show ?
    By Man_world in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Oct 2006, 04:42 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