From b71cff1d57bc82fab0423ad64cab6b5a8f32463a Mon Sep 17 00:00:00 2001 From: dinamiko Date: Fri, 1 Jul 2022 14:57:59 +0200 Subject: [PATCH 1/2] Check pui currency in payment gateways --- modules/ppcp-wc-gateway/src/WCGatewayModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index 5d85638f1..acd2833fe 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -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' === get_woocommerce_currency() ) { $methods[] = $container->get( 'wcgateway.pay-upon-invoice-gateway' ); } From 86f85eff635817e701f24936de61f1d7782e5288 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Fri, 1 Jul 2022 15:50:14 +0200 Subject: [PATCH 2/2] Use shop currency service --- modules/ppcp-wc-gateway/src/WCGatewayModule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index acd2833fe..8bb469a9d 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -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' ) && 'EUR' === get_woocommerce_currency() ) { + if ( 'DE' === $container->get( 'api.shop.country' ) && 'EUR' === $container->get( 'api.shop.currency' ) ) { $methods[] = $container->get( 'wcgateway.pay-upon-invoice-gateway' ); }