get_woocommerce_price_format()WC 1.0

Get the price format depending on the currency position.

Хуки из функции

Возвращает

Строку.

Использование

get_woocommerce_price_format();

Код get_woocommerce_price_format() WC 8.7.0

function get_woocommerce_price_format() {
	$currency_pos = get_option( 'woocommerce_currency_pos' );
	$format       = '%1$s%2$s';

	switch ( $currency_pos ) {
		case 'left':
			$format = '%1$s%2$s';
			break;
		case 'right':
			$format = '%2$s%1$s';
			break;
		case 'left_space':
			$format = '%1$s %2$s';
			break;
		case 'right_space':
			$format = '%2$s %1$s';
			break;
	}

	return apply_filters( 'woocommerce_price_format', $format, $currency_pos );
}