تابع ووکامرسی get_woocommerce_price_format نمایش قیمت فرمت شده محصول

تابع ووکامرسی get_woocommerce_price_format – نمایش قیمت فرمت شده محصول با توجه به واحد پولی
Syntax – سینتکس
(string) get_woocommerce_price_format();
Usage – نحوه استفاده
if ( !function_exists( 'get_woocommerce_price_format' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php';
}
// NOTICE! Understand what this does before running.
$result = get_woocommerce_price_format();
Defined – محل تعریف
/includes/wc-formatting-functions.php
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 );
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر