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

تابع ووکامرسی wc_format_price_range – فرمت محدوده قیمت برای نمایش در فروشگاه
Syntax – سینتکس
(string) wc_format_price_range( (string) $from, (string) $to );
Parameters – پارامتر ها (2)
- 1- $from (string)
- 2- $to (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_format_price_range' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php';
}
// The from.
$from = '';
// The to.
$to = '';
// NOTICE! Understand what this does before running.
$result = wc_format_price_range($from, $to);
Defined – محل تعریف
/includes/wc-formatting-functions.php
function wc_format_price_range( $from, $to ) {
$price = sprintf( _x( '%1$s – %2$s', 'Price range: from-to', woocommerce ), is_numeric( $from ) ? wc_price( $from ) : $from, is_numeric( $to ) ? wc_price( $to ) : $to );
return apply_filters( 'woocommerce_format_price_range', $price, $from, $to );
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر