You can add these hooks to variables in template.php to alter the data that generates the switcher.
Custom Variable args in template.php
add_filter('yay_currency_switcher_template_args', 'yay_currency_switcher_template_args');
function yay_currency_switcher_template_args( $args ) {
$args['is_show_flag'] = '0'; // if you don't want to show flag in Dropdown and otherwise '1'...Default: get value in settings.
$args['is_show_currency_name'] = '0'; // if you don't want to show Currency name in Dropdown and otherwise '1'...Default: get value in settings.
$args['is_show_currency_code'] = '0'; // if you don't want to show Currency code in Dropdown and otherwise '1'...Default: get value in settings.
$args['switcher_size'] = 'large'; // custom switcher size ( small | large )
//...
return $args;
}
Get cart subtotal by current currency: yay_currency_get_cart_subtotal
Get the shipping total by the current currency or fallback currency: yay_currency_get_shipping_total (PRO version only).
Get the total discount by the current currency or fallback currency: yay_currency_get_discount_total (PRO version only).
Get the total tax by the current currency: yay_currency_get_total_tax (PRO version only).
Get the total fee by current currency: yay_currency_get_fee_total (PRO version only).
Get the cart total by the current currency or fallback currency: yay_currency_get_cart_total (PRO version only).
Get the exchange rate for the current currency: yay_currency_rate
Customize the current currency based on your conditions: yay_currency_apply_currency
Customize the currency code: yay_currency_woocommerce_currency
Customize the currency symbol: yay_currency_woocommerce_currency_symbol
Customize the price format: yay_currency_custom_price_format
Customize product prices based on the current currency: yay_currency_get_price_by_currency
Added: yay_currency_by_country_code and yay_currency_by_billing_country_code are filter hooks to retrieve the currency based on the country code. (Pro version only)
Added: yay_currency_convert_price and yay_currency_revert_price are filter hooks to convert prices to the current currency and revert them to the default currency.
Added: yay_currency_product_price_with_caching filter hook support for the caching option. (Pro version only)
Change custom_flag
Added:yay_currency_will_not_round_shipping_costfilter hook to disable rounding of the shipping fee.
Added: filter hooks to allow custom currencies and change currency flags.
usage:
use Yay_Currency\Helpers\YayCurrencyHelper;
//9.1. Get the shipping total by current currency
$current_currency = YayCurrencyHelper::detect_current_currency();
$cart_total = apply_filters( 'yay_currency_get_shipping_total', 0, $current_currency, false );
//9.2. Get the shipping total by fallback currency
$fallback_currency = YayCurrencyHelper::get_fallback_currency();
$cart_total = apply_filters( 'yay_currency_get_shipping_total', 0, $fallback_currency, true );
usage:
use Yay_Currency\Helpers\YayCurrencyHelper;
//10.1. Get the total discount by current currency
$current_currency = YayCurrencyHelper::detect_current_currency();
$cart_total = apply_filters( 'yay_currency_get_discount_total', 0, $current_currency, false );
//10.2. Get the total discount by fallback currency
$fallback_currency = YayCurrencyHelper::get_fallback_currency();
$cart_total = apply_filters( 'yay_currency_get_discount_total', 0, $fallback_currency, true );
usage:
use Yay_Currency\Helpers\YayCurrencyHelper;
//13.1. Get the cart total by by current currency
$current_currency = YayCurrencyHelper::detect_current_currency();
$cart_total = apply_filters( 'yay_currency_get_cart_total', 0, $current_currency, false );
//13.2. Get the cart total by by fallback currency
$fallback_currency = YayCurrencyHelper::get_fallback_currency();
$cart_total = apply_filters( 'yay_currency_get_cart_total', 0, $fallback_currency, true );