Automattic\WooCommerce\StoreApi\Schemas\V1

CartItemSchema::get_properties │ public │ WC 11.3.0

Get the cart item schema properties.

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

Хуков нет.

Возвращает

array.

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

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

Список изменений

С версии 11.3.0 Введена.

Код CartItemSchema::get_properties() WC 11.3.0

public function get_properties() {
	$properties                    = parent::get_properties();
	$properties['parent_item_key'] = [
		'description' => __( 'Key of the parent cart item, or null if this item is standalone.', 'woocommerce' ),
		'type'        => [ 'string', 'null' ],
		'context'     => [ 'view', 'edit' ],
		'readonly'    => true,
		'default'     => null,
	];

	return $properties;
}