The following code snippet can be used in a hook_form_alter to set the default value of the currency select box for non-required money fields.

<?php
function example_form_alter(&$form, &$form_state, $form_id){
  if( $form_id == 'my_node_form' ){
    // Set default currency select value for all money fields on the form
    $default_currency = variable_get('site_default_currency', 'USD');
    foreach($form['#field_info'] as $field_name => $field){
      if($field['type'] == 'money'){
        $form[$field_name][0]['#default_value']['currency'] = $default_currency;        
      }
    }
  }
}
?>

DT

Comments

liquidcms’s picture

i don't see a default site currency anywhere

kenorb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.