Skip to content

Instantly share code, notes, and snippets.

@Kodzhesyan
Last active March 5, 2023 17:28
Show Gist options
  • Save Kodzhesyan/2d3d4889178aed0ee78537d0b04238b7 to your computer and use it in GitHub Desktop.
Save Kodzhesyan/2d3d4889178aed0ee78537d0b04238b7 to your computer and use it in GitHub Desktop.
додає валюту Українська гривня (UAH) до WooCommerce
<?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