WC_Cart::reset_totals()
Reset cart totals to the defaults. Useful before running calculations.
Method of the class: WC_Cart{}
Hooks from the method
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->reset_totals();
WC_Cart::reset_totals() WC Cart::reset totals code WC 9.5.1
private function reset_totals() { $this->totals = $this->default_totals; $this->fees_api->remove_all_fees(); do_action( 'woocommerce_cart_reset', $this, false ); }