This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:on_updateStateList AJAX handler

Defined in /modules/shop/classes/shop_actions.php, lines 1607-1613
Author LemonStand eCommerce Inc.
Allows to update a list of states when a customer select some country in the country list. Usually this AJAX handler used on the Checkout page together with shop:checkout action, but it can be used on any other page for updating the state list. Usage example:
<select id="country" name="country" onchange="return this.getForm().sendRequest(
  'shop:on_updateStateList',
  {extraFields: {
    'country': $(this).get('value'), 
    'control_name': 'state', 
    'control_id': 'state', 
    'current_state': '<?= $shipping_info->state ?>'},
  update: {'shipping_states': 'shop:state_selector'}
})">
To make the state list updatable, place it into a separate partial. In the code example above the partial is called shop:state_selector. The parameters control_name, control_id, current_state are passed into the state list partial by LemonStand when it handles the shop:on_updateStateList request. You can use these parameters in the state list partial highlighting a currently selected state.

Supported form fields

Field Type Description
country integer specifies the selected country identifier. Required.
control_name string specifies the state selector element name. Required.
control_id string specifies the state selector element identifier. Required.
current_state integer specifies the selected state identifier.

Generated PHP variables

Variable Type Description
control_name string specifies the state selector element name.
control_id string specifies the state selector element identifier.
current_state integer specifies the selected state identifier.

Supported form field details

country form field

Specifies the selected country identifier. Required.

control_name form field

Specifies the state selector element name. Required.

control_id form field

Specifies the state selector element identifier. Required.

current_state form field

Specifies the selected state identifier.

Generated PHP variable details

control_name variable

string $control_name;
Specifies the state selector element name.

control_id variable

string $control_id;
Specifies the state selector element identifier.

current_state variable

integer $current_state;
Specifies the selected state identifier.