WordPress at Your Fingertips
function is not described

WC_Cart::set_total_tax() public WC 3.2.0

Set total tax amount.

{} It's a method of the class: WC_Cart{}

No Hooks.


null. Nothing.


$WC_Cart = new WC_Cart();
$WC_Cart->set_total_tax( $value );
$value(string) (required)
Value to set.


Since 3.2.0 Introduced.

Code of WC_Cart::set_total_tax() WC 5.7.1

public function set_total_tax( $value ) {
	// We round here because this is a total entry, as opposed to line items in other setters.
	$this->totals['total_tax'] = wc_round_tax_total( $value );