Filtro wpcs_price
Manipulación del precio mediante un hook, por ejemplo para redondearlo. El hook se encuentra en public function price().
add_filter('wpcs_price', function($price) {
//http://stackoverflow.com/questions/11692770/rounding-to-nearest-50-cents
//return $price = round($price * 2, 0) / 2;
return round($price, 0, PHP_ROUND_HALF_EVEN);
});o bien otro ejemplo relacionado con: https://wordpress.org/support/topic/how-can-i-round-the-prices
add_filter('wpcs_price', function ($price) {
global $WPCS;
//https://wp-currency.com/function/wpcs-current_currency
if ($WPCS AND $WPCS->current_currency !== 'USD') {
return $price = round($price / 100, 0) * 100;
}
return $price;
});