mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Remove PUI tab when PUI is not active for PayPal account
This commit is contained in:
parent
7ffbb5e159
commit
94261d8ea1
1 changed files with 7 additions and 0 deletions
|
@ -252,6 +252,13 @@ return array(
|
|||
unset( $sections['ppcp-credit-card-gateway'] );
|
||||
}
|
||||
|
||||
$pui_product_status = $container->get( 'wcgateway.pay-upon-invoice-product-status' );
|
||||
assert( $pui_product_status instanceof PayUponInvoiceProductStatus );
|
||||
|
||||
if ( ! $pui_product_status->pui_is_active() ) {
|
||||
unset( $sections[ PayUponInvoiceGateway::ID ] );
|
||||
}
|
||||
|
||||
return $sections;
|
||||
},
|
||||
'wcgateway.settings.status' => static function ( ContainerInterface $container ): SettingsStatus {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue