From ef75a28ca5cd1703c8fee93d14d3860c5ffbc5fe Mon Sep 17 00:00:00 2001 From: Anindra Das Bivas Date: Thu, 14 May 2026 11:48:00 +0600 Subject: [PATCH 1/3] Fix: Partial refund is sending course enrollment mail --- ecommerce/HooksHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecommerce/HooksHandler.php b/ecommerce/HooksHandler.php index 7bdd5752d5..367ef5933a 100644 --- a/ecommerce/HooksHandler.php +++ b/ecommerce/HooksHandler.php @@ -411,7 +411,7 @@ public function manage_earnings_and_enrollments( string $order_status, int $orde } } - if ( OrderModel::ORDER_COMPLETED === $order_status ) { + if ( OrderModel::ORDER_COMPLETED === $order_status && OrderModel::PAYMENT_PARTIALLY_REFUNDED !== $order->payment_status ) { do_action( 'tutor_after_enrolled', $object_id, $student_id, $has_enrollment->ID ); } } From 2dc3e2ed00cbe08bc7eb7e4bde470985d9a8fba0 Mon Sep 17 00:00:00 2001 From: Anindra Das Bivas Date: Thu, 14 May 2026 12:47:31 +0600 Subject: [PATCH 2/3] Fix: Fatal error if total marks is 0 --- templates/learning-area/quiz/content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/learning-area/quiz/content.php b/templates/learning-area/quiz/content.php index af3c199d36..f05b494a31 100644 --- a/templates/learning-area/quiz/content.php +++ b/templates/learning-area/quiz/content.php @@ -33,7 +33,7 @@ $quiz_attempt = ( new QuizModel() )->get_quiz_attempt( $quiz_id, $user_id ?? get_current_user_id() ); $earned_marks = 0; -if ( $quiz_attempt ) { +if ( $quiz_attempt && $total_marks > 0 ) { $earned_marks = (float) $quiz_attempt->earned_marks; $total = (float) $total_marks; $earned_marks = number_format( ( $earned_marks / $total_marks ) * 100, 2 ); From 607440b0130ce734ea7f08f032a5f59008bf8ce7 Mon Sep 17 00:00:00 2001 From: Anindra Das Bivas Date: Thu, 14 May 2026 12:49:05 +0600 Subject: [PATCH 3/3] revert changes --- templates/learning-area/quiz/content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/learning-area/quiz/content.php b/templates/learning-area/quiz/content.php index f05b494a31..af3c199d36 100644 --- a/templates/learning-area/quiz/content.php +++ b/templates/learning-area/quiz/content.php @@ -33,7 +33,7 @@ $quiz_attempt = ( new QuizModel() )->get_quiz_attempt( $quiz_id, $user_id ?? get_current_user_id() ); $earned_marks = 0; -if ( $quiz_attempt && $total_marks > 0 ) { +if ( $quiz_attempt ) { $earned_marks = (float) $quiz_attempt->earned_marks; $total = (float) $total_marks; $earned_marks = number_format( ( $earned_marks / $total_marks ) * 100, 2 );