commerce-8.x-2.8/modules/price/commerce_price.module
modules/price/commerce_price.module
<?php
/**
* @file
* Defines the Currency entity and the Price field.
*/
use Drupal\language\Entity\ConfigurableLanguage;
/**
* Implements hook_theme().
*/
function commerce_price_theme() {
return [
'commerce_price_plain' => [
'variables' => [
'number' => 0,
'currency' => NULL,
],
'template' => 'commerce-price-plain',
],
];
}
/**
* Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.
*/
function commerce_price_configurable_language_insert(ConfigurableLanguage $language) {
if (!\Drupal::isConfigSyncing()) {
// Import currency translations for the new language.
$importer = \Drupal::service('commerce_price.currency_importer');
$importer->importTranslations([$language->getId()]);
}
}
