Automattic\WooCommerce\Internal\ProductFeed\Mapping

UcpProductMapper::price │ private │ WC 1.0

Build a price object from a Store API minor-unit amount.

Method of the class: UcpProductMapper{}

No Hooks.

Returns

array.

Usage

// private - for code of main (parent) class only
$result = $this->price( $amount, $currency ): array;
$amount(mixed) (required)
Amount in minor units, as the Store API formats it.
$currency(string) (required)
ISO 4217 currency code.

UcpProductMapper::price() code WC 11.3.0

private function price( $amount, string $currency ): array {
	return array(
		'amount'   => (int) $amount,
		'currency' => $currency,
	);
}