Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders\Schema
OrderItemSchema::get_product_data_schema
Get embedded product schema.
Method of the class: OrderItemSchema{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->get_product_data_schema(): array;
OrderItemSchema::get_product_data_schema() OrderItemSchema::get product data schema code WC 10.4.3
private function get_product_data_schema(): array {
return array(
'name' => array(
'description' => __( 'Product name.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'permalink' => array(
'description' => __( 'Product permalink.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'sku' => array(
'description' => __( 'Product SKU.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'global_unique_id' => array(
'description' => __( 'Product global unique ID.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'type' => array(
'description' => __( 'Product type.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'is_virtual' => array(
'description' => __( 'Product is virtual.', 'woocommerce' ),
'type' => 'boolean',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'is_downloadable' => array(
'description' => __( 'Product is downloadable.', 'woocommerce' ),
'type' => 'boolean',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
'needs_shipping' => array(
'description' => __( 'Product needs shipping.', 'woocommerce' ),
'type' => 'boolean',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
);
}