Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds\Schema
RefundPreviewSchema::get_section_schema
Schema for one section of the breakdown (products, shipping, or fees).
Метод класса: RefundPreviewSchema{}
Хуков нет.
Возвращает
array.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_section_schema( $section_key ): array;
- $section_key(строка) (обязательный)
- One of
'products','shipping','fees'. Determines which item schema variant is used.
Код RefundPreviewSchema::get_section_schema() RefundPreviewSchema::get section schema WC 11.2.2
private function get_section_schema( string $section_key ): array {
return array(
'type' => 'object',
'properties' => array(
'items' => array(
'description' => __( 'Line items in this section.', 'woocommerce' ),
'type' => 'array',
'items' => 'products' === $section_key ? $this->get_product_item_schema() : $this->get_base_item_schema(),
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'subtotal' => array(
'description' => __( 'Section subtotal (excluding tax).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'tax' => array(
'description' => __( 'Section tax total.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
'total' => array(
'description' => __( 'Section total (tax-inclusive).', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
),
),
);
}