From 4e9ddb5206d4d09be9dbf00924f27be62a51e9d5 Mon Sep 17 00:00:00 2001 From: Hsing-yu Flowers Date: Thu, 22 Jun 2023 13:06:12 -0700 Subject: [PATCH] Add order number to checkout schema (https://github.com/woocommerce/woocommerce-blocks/pull/9927) * Add order number to checkout schema * Update description --- .../src/StoreApi/Schemas/V1/CheckoutSchema.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CheckoutSchema.php b/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CheckoutSchema.php index 61445c896fe..5629c1168d6 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CheckoutSchema.php +++ b/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CheckoutSchema.php @@ -83,6 +83,12 @@ class CheckoutSchema extends AbstractSchema { 'context' => [ 'view', 'edit' ], 'readonly' => true, ], + 'order_number' => [ + 'description' => __( 'Order number used for display.', 'woo-gutenberg-products-block' ), + 'type' => 'string', + 'context' => [ 'view', 'edit' ], + 'readonly' => true, + ], 'customer_note' => [ 'description' => __( 'Note added to the order by the customer during checkout.', 'woo-gutenberg-products-block' ), 'type' => 'string', @@ -188,6 +194,7 @@ class CheckoutSchema extends AbstractSchema { 'order_id' => $order->get_id(), 'status' => $order->get_status(), 'order_key' => $order->get_order_key(), + 'order_number' => $order->get_order_number(), 'customer_note' => $order->get_customer_note(), 'customer_id' => $order->get_customer_id(), 'billing_address' => $this->billing_address_schema->get_item_response( $order ),