WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CartSchema::get_properties() public WC 1.0

Cart schema properties.

{} Это метод класса: CartSchema{}

Хуков нет.

Возвращает

Массив.

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

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

Код CartSchema::get_properties() WC 4.7.0

<?php
public function get_properties() {
	return [
		'coupons'          => [
			'description' => __( 'List of applied cart coupons.', 'woocommerce' ),
			'type'        => 'array',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => [
				'type'       => 'object',
				'properties' => $this->force_schema_readonly( $this->coupon_schema->get_properties() ),
			],
		],
		'shipping_rates'   => [
			'description' => __( 'List of available shipping rates for the cart.', 'woocommerce' ),
			'type'        => 'array',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => [
				'type'       => 'object',
				'properties' => $this->force_schema_readonly( $this->shipping_rate_schema->get_properties() ),
			],
		],
		'shipping_address' => [
			'description' => __( 'Current set shipping address for the customer.', 'woocommerce' ),
			'type'        => 'object',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => [
				'type'       => 'object',
				'properties' => $this->force_schema_readonly( $this->shipping_address_schema->get_properties() ),
			],
		],
		'items'            => [
			'description' => __( 'List of cart items.', 'woocommerce' ),
			'type'        => 'array',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => [
				'type'       => 'object',
				'properties' => $this->force_schema_readonly( $this->item_schema->get_properties() ),
			],
		],
		'items_count'      => [
			'description' => __( 'Number of items in the cart.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'items_weight'     => [
			'description' => __( 'Total weight (in grams) of all products in the cart.', 'woocommerce' ),
			'type'        => 'number',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'needs_payment'    => [
			'description' => __( 'True if the cart needs payment. False for carts with only free products and no shipping costs.', 'woocommerce' ),
			'type'        => 'boolean',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'needs_shipping'   => [
			'description' => __( 'True if the cart needs shipping. False for carts with only digital goods or stores with no shipping methods set-up.', 'woocommerce' ),
			'type'        => 'boolean',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'totals'           => [
			'description' => __( 'Cart 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_items'        => [
						'description' => __( 'Total price of items in the cart.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_items_tax'    => [
						'description' => __( 'Total tax on items in the cart.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_fees'         => [
						'description' => __( 'Total price of any applied fees.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_fees_tax'     => [
						'description' => __( 'Total tax on fees.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_discount'     => [
						'description' => __( 'Total discount from applied coupons.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_discount_tax' => [
						'description' => __( 'Total tax removed due to discount from applied coupons.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_shipping'     => [
						'description' => __( 'Total price of shipping.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_shipping_tax' => [
						'description' => __( 'Total tax on shipping.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_price'        => [
						'description' => __( 'Total price the customer will pay.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'total_tax'          => [
						'description' => __( 'Total tax applied to items and shipping.', 'woocommerce' ),
						'type'        => 'string',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
					],
					'tax_lines'          => [
						'description' => __( 'Lines of taxes applied to items and shipping.', 'woocommerce' ),
						'type'        => 'array',
						'context'     => [ 'view', 'edit' ],
						'readonly'    => true,
						'items'       => [
							'type'       => 'object',
							'properties' => [
								'name'  => [
									'description' => __( 'The name of the tax.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
								'price' => [
									'description' => __( 'The amount of tax charged.', 'woocommerce' ),
									'type'        => 'string',
									'context'     => [ 'view', 'edit' ],
									'readonly'    => true,
								],
							],
						],
					],
				]
			),
		],
		'errors'           => [
			'description' => __( 'List of cart item errors, for example, items in the cart which are out of stock.', 'woocommerce' ),
			'type'        => 'array',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
			'items'       => [
				'type'       => 'object',
				'properties' => $this->force_schema_readonly( $this->error_schema->get_properties() ),
			],
		],
	];
}