Automattic\WooCommerce\Blocks\Assets
AssetDataRegistry::get_currency_data
Get currency data to include in settings.
Method of the class: AssetDataRegistry{}
No Hooks.
Returns
array.
Usage
// protected - for code of main (parent) or child class $result = $this->get_currency_data();
AssetDataRegistry::get_currency_data() AssetDataRegistry::get currency data code WC 11.2.1
protected function get_currency_data() {
$currency = get_woocommerce_currency();
return [
'code' => $currency,
'precision' => wc_get_price_decimals(),
'symbol' => html_entity_decode( get_woocommerce_currency_symbol( $currency ) ),
'symbolPosition' => get_option( 'woocommerce_currency_pos' ),
'decimalSeparator' => PriceSeparators::get_decimal(),
'thousandSeparator' => PriceSeparators::get_thousand(),
'priceFormat' => html_entity_decode( get_woocommerce_price_format() ),
];
}