تابع ووکامرسی wc_round_tax_total رٌند کردن هزینه مالیات محصول

تابع ووکامرسی wc_round_tax_total – رٌند کردن هزینه مالیات محصول
Syntax – سینتکس
wc_round_tax_total( (mixed) $tax );
Parameters – پارامتر ها (1)
- 1- $tax (mixed)
Usage – نحوه استفاده
if ( !function_exists( 'wc_round_tax_total' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php';
}
// The tax.
$tax = null;
// NOTICE! Understand what this does before running.
$result = wc_round_tax_total($tax);
Defined – محل تعریف
/includes/wc-formatting-functions.php
function wc_round_tax_total( $tax ) {
$dp = wc_get_price_decimals();
// @codeCoverageIgnoreStart
if ( version_compare( phpversion(), '5.3', '<' ) ) {
$rounded_tax = round( $tax, $dp );
} else {
// @codeCoverageIgnoreEnd
$rounded_tax = round( $tax, $dp, WC_TAX_ROUNDING_MODE );
}
return apply_filters( 'wc_round_tax_total', $rounded_tax, $tax, $dp, WC_TAX_ROUNDING_MODE );
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
لیست نظرات
سلام الان کدوم کد رو در فانکشن بزاریم؟؟
از تابع wc_round_tax_total می تونید در هر جایی استفاده کنید مثل :