From 1defb3fb4fd967acdbb0ff1ea12045c9ce352f38 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 1 Oct 2015 10:05:10 +0200 Subject: [PATCH 1/2] Explain the fees method in more detail. Closes #9231 Closes #9193 --- includes/class-wc-cart.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 645cba52807..28dcb6ff4b3 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1899,12 +1899,12 @@ class WC_Cart { /*-----------------------------------------------------------------------------------*/ /** - * add_fee function. + * Add additional fee to the cart * - * @param mixed $name - * @param mixed $amount - * @param bool $taxable (default: false) - * @param string $tax_class (default: '') + * @param string $name Unique name for the fee. Multiple fees of the same name cannot be added. + * @param float $amount Fee amount. + * @param bool $taxable (default: false) Is the fee taxable? + * @param string $tax_class (default: '') The tax class for the fee if taxable. A blank string is standard tax class. */ public function add_fee( $name, $amount, $taxable = false, $tax_class = '' ) { From 0547c01418bf564705fb57bf0d0fcb3d3859532e Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 1 Oct 2015 10:14:42 +0200 Subject: [PATCH 2/2] [API] Removed useless _order_number param in POST/PUT orders, closes #9250 --- includes/api/class-wc-api-orders.php | 12 ------------ includes/api/v2/class-wc-api-orders.php | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/includes/api/class-wc-api-orders.php b/includes/api/class-wc-api-orders.php index e293b3cce6f..cebbf96556c 100644 --- a/includes/api/class-wc-api-orders.php +++ b/includes/api/class-wc-api-orders.php @@ -470,12 +470,6 @@ class WC_API_Orders extends WC_API_Resource { update_post_meta( $order->id, '_order_currency', $data['currency'] ); } - // set order number - if ( isset( $data['order_number'] ) ) { - - update_post_meta( $order->id, '_order_number', $data['order_number'] ); - } - // set order meta if ( isset( $data['order_meta'] ) && is_array( $data['order_meta'] ) ) { $this->set_order_meta( $order->id, $data['order_meta'] ); @@ -640,12 +634,6 @@ class WC_API_Orders extends WC_API_Resource { update_post_meta( $order->id, '_order_currency', $data['currency'] ); } - // set order number - if ( isset( $data['order_number'] ) ) { - - update_post_meta( $order->id, '_order_number', $data['order_number'] ); - } - // if items have changed, recalculate order totals if ( $update_totals ) { $order->calculate_totals(); diff --git a/includes/api/v2/class-wc-api-orders.php b/includes/api/v2/class-wc-api-orders.php index 4dda92fa6bc..cdcfa3b9979 100644 --- a/includes/api/v2/class-wc-api-orders.php +++ b/includes/api/v2/class-wc-api-orders.php @@ -470,12 +470,6 @@ class WC_API_Orders extends WC_API_Resource { update_post_meta( $order->id, '_order_currency', $data['currency'] ); } - // set order number - if ( isset( $data['order_number'] ) ) { - - update_post_meta( $order->id, '_order_number', $data['order_number'] ); - } - // set order meta if ( isset( $data['order_meta'] ) && is_array( $data['order_meta'] ) ) { $this->set_order_meta( $order->id, $data['order_meta'] ); @@ -640,12 +634,6 @@ class WC_API_Orders extends WC_API_Resource { update_post_meta( $order->id, '_order_currency', $data['currency'] ); } - // set order number - if ( isset( $data['order_number'] ) ) { - - update_post_meta( $order->id, '_order_number', $data['order_number'] ); - } - // if items have changed, recalculate order totals if ( $update_totals ) { $order->calculate_totals();