Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
Payments::is_woopayments_installed
Check if the WooPayments plugin is installed.
Method of the class: Payments{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->is_woopayments_installed(): bool;
Payments::is_woopayments_installed() Payments::is woopayments installed code WC 11.0.1
private function is_woopayments_installed(): bool {
if ( $this->is_woopayments_active() ) {
// If it is active, it is also installed.
return true;
}
$woopayments_suggestion = $this->get_woopayments_suggestion();
// We should have the WooPayments suggestion, but if not, return false.
if ( ! $woopayments_suggestion ) {
return false;
}
// Check if the suggestion has its plugin installed.
if ( ! empty( $woopayments_suggestion['plugin']['status'] ) &&
PaymentsProviders::EXTENSION_INSTALLED === $woopayments_suggestion['plugin']['status'] ) {
return true;
}
return false;
}