Merge pull request #427 from woocommerce/pcp-467-currency

Do not use get_woocommerce_currency
This commit is contained in:
Emili Castells 2022-01-11 10:13:31 +01:00 committed by GitHub
commit 0b97b1a69f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -322,7 +322,13 @@ return array(
},
'api.shop.currency' => static function ( ContainerInterface $container ) : string {
return get_woocommerce_currency();
// We use option instead of get_woocommerce_currency
// because it will not be overridden by currency switching plugins.
$currency = get_option( 'woocommerce_currency' );
if ( ! $currency ) {
return 'NO_CURRENCY'; // Unlikely to happen.
}
return $currency;
},
'api.shop.country' => static function ( ContainerInterface $container ) : string {
$location = wc_get_base_location();