Remove PUI tab when PUI is not active for PayPal account

This commit is contained in:
Narek Zakarian 2022-11-11 18:28:02 +04:00
parent 7ffbb5e159
commit 94261d8ea1

View file

@ -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 {