leeboycymru
Programmer
I am workign in zen ecommerce and I am having difficulty getting some help in the forums there, fo my problem.
I have a drop down list that is filled dynamically with countries. Basically in this one part all I need is 13 countries which i have a list for.
Below is the code that ultimately displays the list:
It uses the function below to pull the countries in:
What I need to do is somehting liek this:
Which does work as it displays, but it doesnt have all the php with it to allow it to work, because when I choose a country and click submit, it doesnt recognise a country has been selected, and creates an error.
I know its big ask, but can anybode see how I can get this working by reading how the php is working, so I can get the drop down list working.
Thanks in advance
Lee
I have a drop down list that is filled dynamically with countries. Basically in this one part all I need is 13 countries which i have a list for.
Below is the code that ultimately displays the list:
Code:
<?php if ($current_page_base == checkout_shipping_address) { ?>
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list_via('zone_country_id', $selected_country, 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
<?php
}
?>
Code:
function zen_get_country_list($name, $selected = '', $parameters = '') {
$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
$countries = zen_get_countries();
for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
$countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}
return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
}
What I need to do is somehting liek this:
Code:
function zen_get_country_list_via($name, $selected = '', $parameters = '') {
?>
<select>
<option>Please select a country</option>
<option>UK</option>
</select>
<?
}
?>
Which does work as it displays, but it doesnt have all the php with it to allow it to work, because when I choose a country and click submit, it doesnt recognise a country has been selected, and creates an error.
I know its big ask, but can anybode see how I can get this working by reading how the php is working, so I can get the drop down list working.
Thanks in advance
Lee