Fix view logic for Setup additional payment providers task (https://github.com/woocommerce/woocommerce-admin/pull/8391)
This commit is contained in:
parent
f306cc2ba5
commit
f43e4caf4b
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: Fix
|
||||
|
||||
Fix view logic for Setup additional payment providers task. #8391
|
|
@ -37,8 +37,19 @@ class AdditionalPayments extends Payments {
|
|||
* @return bool
|
||||
*/
|
||||
public function can_view() {
|
||||
if ( ! Features::is_enabled( 'payment-gateway-suggestions' ) ) {
|
||||
// Hide task if feature not enabled.
|
||||
return false;
|
||||
}
|
||||
|
||||
$woocommerce_payments = new WooCommercePayments();
|
||||
return Features::is_enabled( 'payment-gateway-suggestions' ) && $woocommerce_payments->can_view();
|
||||
|
||||
if ( $woocommerce_payments->is_requested() && $woocommerce_payments->is_supported() && ! $woocommerce_payments->is_connected() ) {
|
||||
// Hide task if WC Pay is installed via OBW, in supported country, but not connected.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue