Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds
DataUtils::convert_line_item_taxes_to_internal_format
Convert line item taxes (schema format) to internal format. This keys arrays by tax ID and has some different naming
Метод класса: DataUtils{}
Хуков нет.
Возвращает
Массив. The converted taxes.
Использование
// private - только в коде основоного (родительского) класса $result = $this->convert_line_item_taxes_to_internal_format( $line_item_taxes );
- $line_item_taxes(массив) (обязательный)
- The taxes to convert.
Код DataUtils::convert_line_item_taxes_to_internal_format() DataUtils::convert line item taxes to internal format WC 10.5.2
private function convert_line_item_taxes_to_internal_format( $line_item_taxes ) {
$prepared_taxes = array();
foreach ( $line_item_taxes as $line_item_tax ) {
if ( ! isset( $line_item_tax['id'], $line_item_tax['refund_total'] ) ) {
continue;
}
$prepared_taxes[ $line_item_tax['id'] ] = $line_item_tax['refund_total'];
}
return $prepared_taxes;
}