WC_Admin_Report::get_currency_tooltip
Return currency tooltip JS based on WooCommerce currency position settings.
Method of the class: WC_Admin_Report{}
No Hooks.
Returns
string.
Usage
$WC_Admin_Report = new WC_Admin_Report(); $WC_Admin_Report->get_currency_tooltip();
WC_Admin_Report::get_currency_tooltip() WC Admin Report::get currency tooltip code WC 11.2.2
public function get_currency_tooltip() {
$currency_symbol = get_woocommerce_currency_symbol();
switch ( get_option( 'woocommerce_currency_pos' ) ) {
case 'right':
$currency_tooltip = 'append_tooltip: ' . wp_json_encode( $currency_symbol, JSON_UNESCAPED_UNICODE );
break;
case 'right_space':
$currency_tooltip = 'append_tooltip: ' . wp_json_encode( ' ' . $currency_symbol, JSON_UNESCAPED_UNICODE );
break;
case 'left':
$currency_tooltip = 'prepend_tooltip: ' . wp_json_encode( $currency_symbol, JSON_UNESCAPED_UNICODE );
break;
case 'left_space':
default:
$currency_tooltip = 'prepend_tooltip: ' . wp_json_encode( $currency_symbol . ' ', JSON_UNESCAPED_UNICODE );
break;
}
return $currency_tooltip;
}