public static function is_compound($key) { global $wpdb; return $wpdb->get_var($wpdb->prepare("SELECT tax_rate_compound FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %s", $key)) ? true : false; }
/** * Get tax row amounts with or without compound taxes includes. * * @return float price */ public function get_taxes_total($compound = true) { $total = 0; foreach ($this->taxes as $key => $tax) { if (!$compound && $this->tax->is_compound($key)) { continue; } $total += $tax; } foreach ($this->shipping_taxes as $key => $tax) { if (!$compound && $this->tax->is_compound($key)) { continue; } $total += $tax; } return $total; }