You are here

function commerce_price_install in Commerce Core 8.2

Implements hook_install().

File

modules/price/commerce_price.install, line 29
Contains install and update functions for Price.

Code

function commerce_price_install() {
  if (!\Drupal::isConfigSyncing()) {

    // Import a currency to speed up initial store setup.
    // If no default country is set, import the US Dollar, since it's common.
    $default_country = \Drupal::config('system.date')
      ->get('country.default');
    $default_country = $default_country ?: 'US';
    $currency_importer = \Drupal::service('commerce_price.currency_importer');
    $currency_importer
      ->importByCountry($default_country);
  }
}