Automattic\WooCommerce\Internal\ProductFeed\Mapping
UcpProductMapper::price
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() UcpProductMapper::price code WC 11.3.0
private function price( $amount, string $currency ): array {
return array(
'amount' => (int) $amount,
'currency' => $currency,
);
}