You are here

function hook_commerce_default_currency_alter in Commerce Core 7

Allows modules to alter the default currency.

Parameters

$currency_code: The default currency code.

See also

commerce_default_currency()

1 invocation of hook_commerce_default_currency_alter()
commerce_default_currency in ./commerce.module
Returns the currency code of the site's default currency.

File

./commerce.api.php, line 189
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_commerce_default_currency_alter(&$currency_code) {
  global $language;
  if (isset($language->language) && $language->language == 'en-US') {
    $currency_code = 'USD';
  }
}