2016-06-09 14 views
2

Ich habe diese Filter in WooCommerce Quellcode:WooCommerce Filter Anpassung (vs Boden Rundung)

$this->total = max(0, apply_filters('woocommerce_calculated_total', round($this->cart_contents_total + $this->tax_total + $this->shipping_tax_total + $this->shipping_total + $this->fee_total, $this->dp), $this)); 

Ich möchte diese Änderung mit meinem Filter anzuwenden, aber ich kann nicht verstehen, wie.

$this->total = max(0, apply_filters('woocommerce_calculated_total', floor(($this->cart_contents_total + $this->tax_total + $this->shipping_tax_total + $this->shipping_total + $this->fee_total) * 100)/100, $this)); 

Jede Hilfe wird geschätzt. Ein Gruß!

Antwort

2

Fertig!

function custom_round_function($total, $cart) { 

$total = floor(($cart->cart_contents_total + $cart->tax_total + $cart->shipping_tax_total + $cart->shipping_total + $cart->fee_total) * 100)/100; 

return $total; 
} 

add_filter('woocommerce_calculated_total', 'custom_round_function', 10, 2);