Automattic\WooCommerce\Internal\StockNotifications\Utilities
EligibilityService::has_active_notifications
Check if a product (or its relevant variations) has any active notifications.
Метод класса: EligibilityService{}
Хуков нет.
Возвращает
bool. True if the product has active notifications, false otherwise.
Использование
$EligibilityService = new EligibilityService(); $EligibilityService->has_active_notifications( $product ): bool;
- $product(WC_Product) (обязательный)
- The product to check.
Код EligibilityService::has_active_notifications() EligibilityService::has active notifications WC 11.2.2
public function has_active_notifications( WC_Product $product ): bool {
$lookup_ids = $this->get_target_product_ids( $product );
if ( empty( $lookup_ids ) ) {
return false;
}
return NotificationQuery::product_has_active_notifications( $lookup_ids );
}