|
@@ 501-508 (lines=8) @@
|
| 498 |
|
} |
| 499 |
|
|
| 500 |
|
// set order currency |
| 501 |
|
if ( isset( $data['currency'] ) ) { |
| 502 |
|
|
| 503 |
|
if ( ! array_key_exists( $data['currency'], get_woocommerce_currencies() ) ) { |
| 504 |
|
throw new WC_API_Exception( 'woocommerce_invalid_order_currency', __( 'Provided order currency is invalid', 'woocommerce'), 400 ); |
| 505 |
|
} |
| 506 |
|
|
| 507 |
|
update_post_meta( $order->id, '_order_currency', $data['currency'] ); |
| 508 |
|
} |
| 509 |
|
|
| 510 |
|
// set order meta |
| 511 |
|
if ( isset( $data['order_meta'] ) && is_array( $data['order_meta'] ) ) { |
|
@@ 652-659 (lines=8) @@
|
| 649 |
|
} |
| 650 |
|
|
| 651 |
|
// Set order currency. |
| 652 |
|
if ( isset( $data['currency'] ) ) { |
| 653 |
|
if ( ! array_key_exists( $data['currency'], get_woocommerce_currencies() ) ) { |
| 654 |
|
throw new WC_API_Exception( 'woocommerce_invalid_order_currency', __( 'Provided order currency is invalid', 'woocommerce' ), 400 ); |
| 655 |
|
} |
| 656 |
|
|
| 657 |
|
update_post_meta( $order->id, '_order_currency', $data['currency'] ); |
| 658 |
|
} |
| 659 |
|
|
| 660 |
|
// If items have changed, recalculate order totals. |
| 661 |
|
if ( $update_totals ) { |
| 662 |
|
$order->calculate_totals(); |