Last active
March 5, 2023 17:28
-
-
Save Kodzhesyan/2d3d4889178aed0ee78537d0b04238b7 to your computer and use it in GitHub Desktop.
додає валюту Українська гривня (UAH) до WooCommerce
This file contains 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
<?php | |
// Добавляем валюту гривня в WooCommerce | |
add_filter('woocommerce_currencies', 'add_my_currency'); | |
function add_my_currency($currencies) { | |
$currencies['UAH'] = __('Українська гривня', 'woocommerce'); | |
return $currencies; | |
} | |
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); | |
function add_my_currency_symbol($currency_symbol, $currency) { | |
switch( $currency ) { | |
case 'UAH': | |
$currency_symbol = 'грн'; | |
break; | |
} | |
return $currency_symbol; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment