address_form_validate($form_id, $form_values)Validate an address being saved
contrib-5/ecommerce/address/address.module, line 559
<?php
function address_form_validate($form_id, $form_values) {
// custom var to ignore states
if ( variable_get('store_ignore_state', FALSE)) {
return;
}
// we need to ensure we have a country
if ($form_values['country'] == "0" ) {
form_set_error('country', t('Country is required.'));
}
// we need either a province or a state
if (!$form_values['province'] && !$form_values['state']) {
form_set_error('state', t('State/province/region is required.'));
form_set_error('province', '');
}
}
?>