تابع ووکامرسی wc_cart_round_discount روند کردن هزینه تخفیف محصول

تابع ووکامرسی wc_cart_round_discount – روند کردن هزینه و مقدار تخفیف (discount) محصول
Syntax – سینتکس
(float) wc_cart_round_discount( (float) $value, (int) $precision );
Parameters – پارامتر ها (2)
- 1- $value (float)
- 2- $precision (int)
Usage – نحوه استفاده
if ( !function_exists( 'wc_cart_round_discount' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-cart-functions.php';
}
// The value.
$value = null;
// The precision.
$precision = -1;
// NOTICE! Understand what this does before running.
$result = wc_cart_round_discount($value, $precision);
Defined – محل تعریف
/includes/wc-cart-functions.php
function wc_cart_round_discount( $value, $precision ) {
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
return round( $value, $precision, WC_DISCOUNT_ROUNDING_MODE );
} else {
return round( $value, $precision );
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر