[REST API] Check if tax subtotal exists before to prevent errors, closes #11270
This commit is contained in:
parent
cf622677ad
commit
ff50570b5c
|
@ -300,8 +300,10 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
|
|||
);
|
||||
}
|
||||
|
||||
foreach ( $fee_line_taxes['subtotal'] as $tax_rate_id => $tax ) {
|
||||
$fee_tax[ $tax_rate_id ]['subtotal'] = $tax;
|
||||
if ( isset( $fee_line_taxes['subtotal'] ) ) {
|
||||
foreach ( $fee_line_taxes['subtotal'] as $tax_rate_id => $tax ) {
|
||||
$fee_tax[ $tax_rate_id ]['subtotal'] = $tax;
|
||||
}
|
||||
}
|
||||
|
||||
$fee_line['taxes'] = array_values( $fee_tax );
|
||||
|
|
Loading…
Reference in New Issue