Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders\Schema
OrderSchema::add_cogs_related_schema
Add the Cost of Goods Sold related fields to the schema.
Метод класса: OrderSchema{}
Хуков нет.
Возвращает
array. The updated schema.
Использование
$result = OrderSchema::add_cogs_related_schema( $schema ): array;
- $schema(массив) (обязательный)
- The original schema.
Код OrderSchema::add_cogs_related_schema() OrderSchema::add cogs related schema WC 11.2.2
private static function add_cogs_related_schema( array $schema ): array {
$schema['cost_of_goods_sold'] = array(
'description' => __( 'Cost of Goods Sold data.', 'woocommerce' ),
'type' => 'object',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'properties' => array(
'total_value' => array(
'description' => __( 'Total value of the Cost of Goods Sold for the order.', 'woocommerce' ),
'type' => 'number',
'readonly' => true,
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
),
);
return $schema;
}