WC_Abstract_Order::get_tax_rates()
Get tax rates for an order. Use order's shipping or billing address, defaults to base location.
Метод класса: WC_Abstract_Order{}
Хуков нет.
Возвращает
Разное|null
. Tax rates.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_tax_rates( $tax_class, $location_args, $customer );
- $tax_class(строка) (обязательный)
- Tax class to get rates for.
- $location_args(массив)
- Location to compute rates for. Should be in form: array( country, state, postcode, city).
По умолчанию: array() - $customer(объект)
- Only used to maintain backward compatibility for filter woocommerce-matched_rates.
По умолчанию: null
Код WC_Abstract_Order::get_tax_rates() WC Abstract Order::get tax rates WC 9.8.1
protected function get_tax_rates( $tax_class, $location_args = array(), $customer = null ) { $tax_location = $this->get_tax_location( $location_args ); $tax_location = array( $tax_location['country'], $tax_location['state'], $tax_location['postcode'], $tax_location['city'] ); return WC_Tax::get_rates_from_location( $tax_class, $tax_location, $customer ); }