Automattic\WooCommerce\StoreApi\Schemas\V1

CartFeeSchema::get_properties()publicWC 1.0

Cart schema properties.

Метод класса: CartFeeSchema{}

Хуков нет.

Возвращает

Массив.

Использование

$CartFeeSchema = new CartFeeSchema();
$CartFeeSchema->get_properties();

Код CartFeeSchema::get_properties() WC 8.7.0

public function get_properties() {
	return [
		'id'     => [
			'description' => __( 'Unique identifier for the fee within the cart.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'name'   => [
			'description' => __( 'Fee name.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'totals' => [
			'description' => __( 'Fee total amounts provided using the smallest unit of the currency.', 'woocommerce' ),
			'type'        => 'object',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'properties'  => array_merge(
				$this->get_store_currency_properties(),
				[
					'total'     => [
						'description' => __( 'Total amount for this fee.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_tax' => [
						'description' => __( 'Total tax amount for this fee.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
				]
			),
		],
	];
}