سلام من دانش برنامه نویسی ضعیفه ممنون می شم راهنمایی کنید.برای کد زیر که از انجمن برداشتم که قیمت ها را رند می کنه . می خوام یه if بذارم که اگر در مثلا دسته بندی حیوانات بود رند نکنه .
add_filter( 'woocommerce_get_price_excluding_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_get_price_including_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_tax_round', 'round_price_product', 10, 1);
add_filter( 'woocommerce_get_price', 'round_price_product', 10, 1);
add_filter( 'woocommerce_calculated_total', 'round_price_product', 10, 1);
function round_price_product( $price ){
// round up
$rounded = ceil( $price / 1000 ) * 1000;
return $rounded;
}
add_filter( 'woocommerce_get_price_excluding_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_get_price_including_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_tax_round', 'round_price_product', 10, 1);
add_filter( 'woocommerce_get_price', 'round_price_product', 10, 1);
add_filter( 'woocommerce_calculated_total', 'round_price_product', 10, 1);
function round_price_product( $price ){
// round up
$rounded = ceil( $price / 1000 ) * 1000;
return $rounded;
}