Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    49
    Plugin Contributions
    0

    Default Empty entries in countries drop down menu

    Very tiny bug appearing in case the Country set up for the top of Countries dropdown meny is actually disabled (status=0) in Admin

    What we have:

    1. zen_get_country_list function, which seems unchanged from v1.3.9 ages

    2. Option to change status of Countres ("Active for shipping") is appeared somehere later in 1.5.x

    3. zen_get_country_name function returning empty string in case the Country is disabled ("Active for shipping" set to No) in Admin

    Thus, in order to avoid entries with no text in $countries_array, some additional check should be added into zen_get_country_list function code:

    Code:
        //process array of top-of-list entries:
        foreach ($countriesAtTopOfList as $key=>$val) {
          if (zen_get_country_name($val) != '') $countries_array[] = array('id' => $val, 'text' => zen_get_country_name($val));
        }
    PS Please do not tell me, calling zen_get_country_name function twice is idiotic - I did this for better visibility only
    PPS Sorry, if my explanations are not very clear, lack of sleep...

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,183
    Plugin Contributions
    11

    Default Re: Empty entries in countries drop down menu


 

 

Similar Threads

  1. v157 Empty entries in countries dropdown menu
    By yesaul in forum Bug Reports
    Replies: 3
    Last Post: 16 Apr 2022, 01:51 PM
  2. Deleting countries from drop down menu
    By monkeybus in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Mar 2017, 07:22 PM
  3. v139g Remove Some of the Countries from Create Account Drop Down Menu
    By clriding in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 Oct 2013, 08:58 PM
  4. Don't need drop down menu for countries
    By Sunabac in forum Basic Configuration
    Replies: 0
    Last Post: 26 Jul 2008, 09:13 PM
  5. change countries in the drop-down menu
    By redrob in forum General Questions
    Replies: 0
    Last Post: 29 May 2008, 12:47 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