gecko Posted July 15, 2005 Share Posted July 15, 2005 Im reposting this cause after an hour of 2 people searching we finaly found it.. a hack to list your favourites in the top of the drop down menu credit to jalal (in includes/functions/html_output.php): CODE function tep_get_country_list($name, $selected = '', $parameters = '') { $favored_countries = array(14,21,57,72,73,81,84,103,105,124,150,171,195,203,222); $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); $countries = tep_get_countries(); $n = sizeof($countries); for ($i=0; $i<$n; $i++) { if( in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } for ($i=0; $i<$n; $i++) { if( !in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); } this time it'll go :-) Link to comment Share on other sites More sharing options...
sarah1980 Posted August 28, 2005 Share Posted August 28, 2005 Im reposting this cause after an hour of 2 people searching we finaly found it.. a hack to list your favourites in the top of the drop down menu credit to jalal (in includes/functions/html_output.php): CODE function tep_get_country_list($name, $selected = '', $parameters = '') { $favored_countries = array(14,21,57,72,73,81,84,103,105,124,150,171,195,203,222); $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); $countries = tep_get_countries(); $n = sizeof($countries); for ($i=0; $i<$n; $i++) { if( in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } for ($i=0; $i<$n; $i++) { if( !in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); } <{POST_SNAPBACK}> I am assuming that this replaces what is there already? Or is it an addition? Link to comment Share on other sites More sharing options...
chondle Posted September 1, 2005 Share Posted September 1, 2005 I am assuming that this replaces what is there already? Or is it an addition? <{POST_SNAPBACK}> It's a replacement: Replace the existing 'tep_get_country_list' function with this one. I have a question: I wanted the countries that I wish to be promoted to the top of list to also REMAIN in there original alphabetical locations in the list. In other words, I want the countries that I choose to promote to be DUPLICATES of the original ones, because I feel that there will be many people that will not spot that their country is at the top of the list, and will therefore scroll down the list to try and find it alphabetically. Does anyone know the code to accomplish this? Thanks, Marc. Link to comment Share on other sites More sharing options...
supplement Posted November 28, 2005 Share Posted November 28, 2005 Im reposting this cause after an hour of 2 people searching we finaly found it.. a hack to list your favourites in the top of the drop down menu credit to jalal (in includes/functions/html_output.php): CODE function tep_get_country_list($name, $selected = '', $parameters = '') { $favored_countries = array(14,21,57,72,73,81,84,103,105,124,150,171,195,203,222); $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); $countries = tep_get_countries(); $n = sizeof($countries); for ($i=0; $i<$n; $i++) { if( in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } for ($i=0; $i<$n; $i++) { if( !in_array($countries[$i]['countries_id'], $favored_countries) ) { $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } } return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); } Hi, The person requested that the countries repeat themselves in alphabetical order, which we would need. Do you have a solution for that? Thank You Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.