diff --git a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php index 37876d43..78f86d44 100644 --- a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php +++ b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php @@ -72,6 +72,14 @@ try { $event_id )); + // Check certificate status for each attendee + if (!empty($attendees) && class_exists('HVAC_Certificate_Manager')) { + $certificate_manager = HVAC_Certificate_Manager::instance(); + foreach ($attendees as $attendee) { + $attendee->has_certificate = $certificate_manager->certificate_exists($event_id, $attendee->attendee_id); + } + } + // Log for debugging if needed if (defined('WP_DEBUG') && WP_DEBUG) { error_log('Generate Certificates - Event ID: ' . $event_id . ', Attendees: ' . count($attendees)); @@ -143,6 +151,22 @@ get_header(); + has_certificate)) { + $has_certificate_count++; + } + } + + if ($has_certificate_count > 0) : ?> +
+

Note: attendee(s) already have certificates. These will be skipped to prevent duplicates.

+

Attendees with existing certificates are marked with ✓ and cannot be selected.

+
+ +
@@ -160,6 +184,7 @@ get_header(); Attendee Name Email Check-in Status + Certificate Status @@ -170,14 +195,20 @@ get_header(); $status_text = $checked_in ? 'Checked In' : 'Not Checked In'; $attendee_name = $attendee->holder_name ?: 'Unknown'; $attendee_email = $attendee->holder_email ?: 'No email'; + $has_certificate = !empty($attendee->has_certificate); + $cert_status_class = $has_certificate ? 'hvac-has-certificate' : ''; ?> - + - > + + > + + + @@ -186,6 +217,13 @@ get_header(); + + + Certificate Issued + + No Certificate + +