$currency_name, '%currency_code%' => $currency_code, '%currency_symbol%' => get_woocommerce_currency_symbol( $currency_code ), '%product_price%' => $product_price, ); return str_replace( array_keys( $replaced_values ), array_values( $replaced_values ), get_option( 'alg_currency_switcher_format', '%currency_name%' ) ); } } if ( ! function_exists( 'alg_get_currency_selector' ) ) { /** * alg_get_currency_selector. * * @version 2.15.2 * @since 1.0.0 */ function alg_get_currency_selector( $type = 'select' ) { $flags_enabled = ( 'yes' === get_option( 'alg_wc_currency_switcher_flags_enabled', 'no' ) && get_option( 'wpwham_currency_switcher_version' ) !== 'legacy' ); $html = ''; $html .= '
'; return str_replace( '%currency_switcher%', $html, get_option( 'alg_currency_switcher_wrapper', '%currency_switcher%' ) ); } } if ( ! function_exists( 'alg_currency_select_drop_down_list' ) ) { /** * alg_currency_select_drop_down_list. * * @version 1.0.0 * @since 1.0.0 */ function alg_currency_select_drop_down_list() { return alg_get_currency_selector( 'select' ); } } if ( ! function_exists( 'alg_currency_select_radio_list' ) ) { /** * alg_currency_select_radio_list. * * @version 1.0.0 * @since 1.0.0 */ function alg_currency_select_radio_list() { return alg_get_currency_selector( 'radio' ); } } if ( ! function_exists( 'alg_currency_select_link_list' ) ) { /** * alg_currency_select_link_list. * * @version 2.8.4 * @since 1.0.0 */ function alg_currency_select_link_list( $atts = array() ) { $flags_enabled = ( 'yes' === get_option( 'alg_wc_currency_switcher_flags_enabled', 'no' ) && get_option( 'wpwham_currency_switcher_version' ) !== 'legacy' ); $function_currencies = alg_get_enabled_currencies(); $currencies = get_woocommerce_currencies(); $selected_currency = alg_get_current_currency_code(); $html = ''; $links = array(); $first_link = ''; foreach ( $function_currencies as $currency_code ) { if ( isset( $currencies[ $currency_code ] ) ) { $flag_img = ''; if ( $flags_enabled ) { $country_code = alg_get_country_flag_code( $currency_code ); $flag_img = '