includes/cli/class-wc-cli-order.php 1 location
|
@@ 751-759 (lines=9) @@
|
| 748 |
|
} |
| 749 |
|
|
| 750 |
|
// Add fees. |
| 751 |
|
foreach ( $order->get_fees() as $fee_item_id => $fee_item ) { |
| 752 |
|
$order_data['fee_lines'][] = array( |
| 753 |
|
'id' => $fee_item_id, |
| 754 |
|
'title' => $fee_item['name'], |
| 755 |
|
'tax_class' => ( ! empty( $fee_item['tax_class'] ) ) ? $fee_item['tax_class'] : null, |
| 756 |
|
'total' => wc_format_decimal( $order->get_line_total( $fee_item ), $dp ), |
| 757 |
|
'total_tax' => wc_format_decimal( $order->get_line_tax( $fee_item ), $dp ), |
| 758 |
|
); |
| 759 |
|
} |
| 760 |
|
|
| 761 |
|
// Add coupons. |
| 762 |
|
foreach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon_item ) { |
includes/api/legacy/v1/class-wc-api-orders.php 1 location
|
@@ 218-227 (lines=10) @@
|
| 215 |
|
} |
| 216 |
|
|
| 217 |
|
// add fees |
| 218 |
|
foreach ( $order->get_fees() as $fee_item_id => $fee_item ) { |
| 219 |
|
|
| 220 |
|
$order_data['fee_lines'][] = array( |
| 221 |
|
'id' => $fee_item_id, |
| 222 |
|
'title' => $fee_item['name'], |
| 223 |
|
'tax_class' => ( ! empty( $fee_item['tax_class'] ) ) ? $fee_item['tax_class'] : null, |
| 224 |
|
'total' => wc_format_decimal( $order->get_line_total( $fee_item ), 2 ), |
| 225 |
|
'total_tax' => wc_format_decimal( $order->get_line_tax( $fee_item ), 2 ), |
| 226 |
|
); |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
// add coupons |
| 230 |
|
foreach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon_item ) { |
includes/api/legacy/v2/class-wc-api-orders.php 1 location
|
@@ 282-291 (lines=10) @@
|
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
// add fees |
| 282 |
|
foreach ( $order->get_fees() as $fee_item_id => $fee_item ) { |
| 283 |
|
|
| 284 |
|
$order_data['fee_lines'][] = array( |
| 285 |
|
'id' => $fee_item_id, |
| 286 |
|
'title' => $fee_item['name'], |
| 287 |
|
'tax_class' => ( ! empty( $fee_item['tax_class'] ) ) ? $fee_item['tax_class'] : null, |
| 288 |
|
'total' => wc_format_decimal( $order->get_line_total( $fee_item ), $dp ), |
| 289 |
|
'total_tax' => wc_format_decimal( $order->get_line_tax( $fee_item ), $dp ), |
| 290 |
|
); |
| 291 |
|
} |
| 292 |
|
|
| 293 |
|
// add coupons |
| 294 |
|
foreach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon_item ) { |
includes/api/legacy/v3/class-wc-api-orders.php 1 location
|
@@ 306-315 (lines=10) @@
|
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
// Add fees. |
| 306 |
|
foreach ( $order->get_fees() as $fee_item_id => $fee_item ) { |
| 307 |
|
$order_data['fee_lines'][] = array( |
| 308 |
|
'id' => $fee_item_id, |
| 309 |
|
'title' => $fee_item['name'], |
| 310 |
|
'tax_class' => ( ! empty( $fee_item['tax_class'] ) ) ? $fee_item['tax_class'] : null, |
| 311 |
|
'total' => wc_format_decimal( $order->get_line_total( $fee_item ), $dp ), |
| 312 |
|
'total_tax' => wc_format_decimal( $order->get_line_tax( $fee_item ), $dp ), |
| 313 |
|
); |
| 314 |
|
} |
| 315 |
|
|
| 316 |
|
// Add coupons. |
| 317 |
|
foreach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon_item ) { |
| 318 |
|
$coupon_line = array( |