[REST API] Add "number" property to orders endpoint, closes #11250

This commit is contained in:
Claudio Sanches 2016-06-27 21:53:08 -03:00
parent cde356b259
commit c7579c5f0b
1 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
'parent_id' => $post->post_parent,
'status' => $order->get_status(),
'order_key' => $order->order_key,
'number' => $order->get_order_number(),
'currency' => $order->get_order_currency(),
'version' => $order->order_version,
'prices_include_tax' => $order->prices_include_tax,
@ -1156,6 +1157,12 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'number' => array(
'description' => __( 'Order number.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'currency' => array(
'description' => __( 'Currency the order was created with, in ISO format.', 'woocommerce' ),
'type' => 'string',