is_vat_exempt data in API Orders

Save and get is_vat_exempt data in API Orders
This commit is contained in:
Peter 2016-01-05 21:24:43 +01:00
parent fc5e1ded54
commit ba32ce62ba
1 changed files with 6 additions and 0 deletions

View File

@ -215,6 +215,7 @@ class WC_API_Orders extends WC_API_Resource {
'tax_lines' => array(),
'fee_lines' => array(),
'coupon_lines' => array(),
'is_vat_exempt' => $order->is_vat_exempt,
);
// Add line items.
@ -471,6 +472,11 @@ class WC_API_Orders extends WC_API_Resource {
}
}
// set is vat exempt
if ( isset( $data['is_vat_exempt'] ) ) {
update_post_meta( $order->id, '_is_vat_exempt', $data['is_vat_exempt'] );
}
// calculate totals and set them
$order->calculate_totals();