Merge pull request #711 from woocommerce/PCP-733-1.9.0-test5---pui-gateway-is-dis

PUI gateway is displayed with unsupported store currency (733)
This commit is contained in:
Emili Castells 2022-07-08 10:31:04 +02:00 committed by GitHub
commit 9de45ae393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,7 @@ class WCGatewayModule implements ModuleInterface {
add_action(
'init',
function () use ( $c ) {
if ( 'DE' === $c->get( 'api.shop.country' ) && 'EUR' === get_woocommerce_currency() ) {
if ( 'DE' === $c->get( 'api.shop.country' ) && 'EUR' === $c->get( 'api.shop.currency' ) ) {
( $c->get( 'wcgateway.pay-upon-invoice' ) )->init();
}
}
@ -284,7 +284,7 @@ class WCGatewayModule implements ModuleInterface {
$methods[] = $container->get( 'wcgateway.credit-card-gateway' );
}
if ( 'DE' === $container->get( 'api.shop.country' ) ) {
if ( 'DE' === $container->get( 'api.shop.country' ) && 'EUR' === $container->get( 'api.shop.currency' ) ) {
$methods[] = $container->get( 'wcgateway.pay-upon-invoice-gateway' );
}