Automattic\WooCommerce\StoreApi\Schemas\V1

AbstractSchema::get_store_currency_properties()protectedWC 1.0

Returns consistent currency schema used across endpoints for prices.

Method of the class: AbstractSchema{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_store_currency_properties();

AbstractSchema::get_store_currency_properties() code WC 9.3.3

protected function get_store_currency_properties() {
	return [
		'currency_code'               => [
			'description' => __( 'Currency code (in ISO format) for returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'currency_symbol'             => [
			'description' => __( 'Currency symbol for the currency which can be used to format returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'currency_minor_unit'         => [
			'description' => __( 'Currency minor unit (number of digits after the decimal separator) for returned prices.', 'woocommerce' ),
			'type'        => 'integer',
			'context'     => [ 'view', 'edit' ],
			'readonly'    => true,
		],
		'currency_decimal_separator'  => array(
			'description' => __( 'Decimal separator for the currency which can be used to format returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'currency_thousand_separator' => array(
			'description' => __( 'Thousand separator for the currency which can be used to format returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'currency_prefix'             => array(
			'description' => __( 'Price prefix for the currency which can be used to format returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
		'currency_suffix'             => array(
			'description' => __( 'Price prefix for the currency which can be used to format returned prices.', 'woocommerce' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit' ),
			'readonly'    => true,
		),
	];
}