This Function Has Been Available Since:|
(AFCommerce v 2.1, Functions v 1.1)
Builds a list of states (zones) for the state's drop down menu field.
afc_build_zones_drop_down_menu (varname, mode, emptystring, selectedvalue)
The drop down menus for country and state can be controled inside the admin area. Based on which states are enabled for your store, a drop down menu of states is generated.
varname (string) - name of the variable used for the html form on the current page.
mode(string) - Which type of values the drop down menu will create for each state's name. Can be "id", which is the state's id number (in the database, most commonly used), or "code", which is the state's 2 digit state code.
emptystring (string) - This will become the first field in the menu. It is named "empty string" because this field will not have a value at all, it is used for a text string like "Please Select A State".
selectedvalue (string) - This is the menu's field that has already be selected. For example, if a member has already selected their state as "Florida", then the next time they see this field Florida will be the selected value.
This function does not have a return value.
Open Source: No
afc_build_zones_drop_down_menu ("zone_id", "id", "Select A State", $state);
Back to Functions List