mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix show payment based on country
This commit is contained in:
parent
4879425e1d
commit
0127512535
1 changed files with 10 additions and 4 deletions
|
@ -38,10 +38,7 @@ class LocalAlternativePaymentMethodsModule implements ModuleInterface {
|
|||
add_filter(
|
||||
'woocommerce_payment_gateways',
|
||||
function ( $methods ) use ( $c ) {
|
||||
if ( is_admin() ) {
|
||||
$methods[] = $c->get( 'ppcp-local-apms.bancontact.wc-gateway' );
|
||||
return $methods;
|
||||
}
|
||||
$methods[] = $c->get( 'ppcp-local-apms.bancontact.wc-gateway' );
|
||||
|
||||
return $methods;
|
||||
}
|
||||
|
@ -49,7 +46,16 @@ class LocalAlternativePaymentMethodsModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_available_payment_gateways',
|
||||
/**
|
||||
* Param types removed to avoid third-party issues.
|
||||
*
|
||||
* @psalm-suppress MissingClosureParamType
|
||||
*/
|
||||
function ( $methods ) use ( $c ) {
|
||||
if ( ! is_array( $methods ) ) {
|
||||
return $methods;
|
||||
}
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
$customer_country = WC()->customer->get_billing_country() ?: WC()->customer->get_shipping_country();
|
||||
$site_currency = get_woocommerce_currency();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue