Created
August 8, 2017 08:48
-
-
Save init90/3923c16ffb56ac645d4b0b0a198ad2c0 to your computer and use it in GitHub Desktop.
drupal 8, commerce, get currency symbol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get currency symbol. | |
| * | |
| * @param object $product_variation | |
| * @return string | |
| */ | |
| public function getCurrencySymbol($product_variation) { | |
| $currency_code = $product_variation->get('price')->currency_code; | |
| $currency = Currency::load($currency_code); | |
| return $currency->getSymbol(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment