Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
71ba4fb
Add Wishlist and Quiz Attempts tabs to student dashboard
nur-alam Jan 5, 2026
12e1f8b
Add star icons and rating component for wishlist feature
nur-alam Jan 5, 2026
cd49718
refactor: clean up commented code and improve wishlist template struc…
nur-alam Jan 6, 2026
11adae8
refactor: enhance course card styling and improve wishlist star ratin…
nur-alam Jan 7, 2026
8941b92
Merge branch '4.0.0-dev' of github.com:themeum/tutor into course-wish…
nur-alam Jan 7, 2026
8439b15
refactor: remove unused star icon files and clean up icon references
nur-alam Jan 7, 2026
6755eb9
refactor: remove is_course_list_page method from Utils class
nur-alam Jan 7, 2026
235aad6
refactor: update wishlist styling and structure for better responsive…
nur-alam Jan 7, 2026
22b09fc
refactor: update icon for Avg. Rating in stat cards
nur-alam Jan 8, 2026
8dc29cc
refactor: remove action hook for course thumbnail in course card temp…
nur-alam Jan 8, 2026
2b44771
refactor: clean up course card template by removing unnecessary white…
nur-alam Jan 8, 2026
0fbcb85
refactor: rename course thumbnail class for consistency in progress c…
nur-alam Jan 8, 2026
f0fa055
refactor: enhance course enrollment functions and improve wishlist ha…
nur-alam Jan 8, 2026
80e7ba0
Merge branch '4.0.0-dev' of github.com:themeum/tutor into course-wish…
nur-alam Jan 8, 2026
6f712b3
fix: adding int typecast
nur-alam Jan 8, 2026
32da88b
fix: correct wishlist retrieval parameters for accurate data display
nur-alam Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion assets/icons/star-2.svg

This file was deleted.

3 changes: 3 additions & 0 deletions assets/icons/star-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/star-half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/star-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/icons/star.svg

This file was deleted.

5 changes: 3 additions & 2 deletions assets/src/js/v3/shared/icons/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ export const icons = [
'sortMinor',
'spinner',
'spreadsheet',
'star',
'star2',
'starFill',
'starHalf',
'starLine',
'stepper',
'stopwatch',
'storeEye',
Expand Down
7 changes: 0 additions & 7 deletions assets/src/scss/frontend/components/_course-card.scss

This file was deleted.

1 change: 0 additions & 1 deletion assets/src/scss/frontend/components/_index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Components styles index
// Import all shared UI components

@forward 'course-card';
@forward 'lesson-item';
@forward 'progress-bar';
@forward 'quiz-question';
Expand Down
59 changes: 39 additions & 20 deletions assets/src/scss/frontend/dashboard/_course-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@

.tutor-course-card {
height: 100%;
display: block;
@include tutor-transition(background-color);

&:hover {
background-color: $tutor-surface-l1-hover;
}

&-thumbnail {
position: relative;
width: 100%;
overflow: hidden;
border-radius: $tutor-radius-sm;
margin-bottom: $tutor-spacing-4;

.tutor-ratio {
width: 100%;
}

img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
}
&-thumbnail {
position: relative;
width: 100%;
overflow: hidden;
border-radius: $tutor-radius-sm;
margin-bottom: $tutor-spacing-4;

.tutor-ratio {
width: 100%;
}

img {
width: 100%;
border-radius: $tutor-radius-sm;
object-fit: cover;
object-position: center;
}
}

&-badge {
position: absolute;
Expand All @@ -39,6 +38,14 @@
z-index: $tutor-z-positive;
}

&-separator {
display: inline-block;
width: 4px;
height: 4px;
background: $tutor-text-subdued;
border-radius: $tutor-radius-lg;
}

&-rating {
margin-bottom: $tutor-spacing-2;

Expand All @@ -63,7 +70,7 @@
}

&-title {
@include tutor-typography('p2', 'medium', 'primary');
@include tutor-typography('small', 'medium', 'primary');
margin-bottom: $tutor-spacing-2;
}

Expand All @@ -78,6 +85,10 @@
padding-top: $tutor-spacing-4;
@include tutor-flex(row, center, flex-start);
gap: $tutor-spacing-5;
@include tutor-typography('small', 'medium', 'primary');
del {
@include tutor-typography('tiny', 'regular', 'subdued');
}
}

&-price {
Expand All @@ -89,3 +100,11 @@
}
}

@media (max-width: $tutor-breakpoint-sm) {
.tutor-dashboard-page-card-body {
&.tutor-dashboard-wishlist-wrapper {
margin: 10px;
border: unset;
}
}
}
5 changes: 2 additions & 3 deletions assets/src/scss/frontend/dashboard/_progress-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
background-color: $tutor-surface-l1-hover;
}

.tutor-courses-thumb {
.tutor-progress-card-thumbnail {
position: relative;
flex: 0 0 200px;
aspect-ratio: 16 / 9;
Expand Down Expand Up @@ -133,11 +133,10 @@
background-color: transparent;
}

.tutor-courses-thumb {
.tutor-progress-card-thumbnail {
width: 100%;
max-width: 100%;
margin-bottom: $tutor-spacing-4;
aspect-ratio: 16 / 9;
}

&-kebab-overlay {
Expand Down
3 changes: 1 addition & 2 deletions classes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ public static function add_frontend_editor_button() {
public function enqueue_scripts() {
$is_dashboard = tutor_utils()->is_dashboard_page();
$is_learning_area = tutor_utils()->is_learning_area();
$is_course_list = tutor_utils()->is_course_list_page();

$core_css_url = tutor()->assets_url . 'css/tutor-core.min.css';
$dashboard_css_url = tutor()->assets_url . 'css/tutor-dashboard.min.css';
Expand All @@ -863,7 +862,7 @@ public function enqueue_scripts() {

$version = TUTOR_ENV === 'DEV' ? time() : TUTOR_VERSION;

if ( $is_dashboard || $is_learning_area || $is_course_list ) {
if ( $is_dashboard || $is_learning_area ) {
$localize_data = apply_filters( 'tutor_localize_data', $this->get_default_localized_data() );

// Core.
Expand Down
5 changes: 3 additions & 2 deletions classes/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ final class Icon {
const SORT_MINOR = 'sort-minor';
const SPINNER = 'spinner';
const SPREADSHEET = 'spreadsheet';
const STAR = 'star';
const STAR_2 = 'star-2';
const STAR_FILL = 'star-fill';
const STAR_HALF = 'star-half';
const STAR_LINE = 'star-line';
const STEPPER = 'stepper';
const STOPWATCH = 'stopwatch';
const STORE_EYE = 'store-eye';
Expand Down
14 changes: 14 additions & 0 deletions classes/Student.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,20 @@ public function get_courses_tab( $active_tab, $post_type_args, $enrolled_course_
),
),
),
array(
'type' => 'link',
'label' => __( 'Wishlist', 'tutor' ),
'icon' => Icon::WISHLIST,
'url' => esc_url( tutor_utils()->tutor_dashboard_url( 'courses/wishlist' ) ),
'active' => 'courses/wishlist' === $active_tab ? true : false,
),
array(
'type' => 'link',
'label' => __( 'Quiz Attempts', 'tutor' ),
'icon' => Icon::QUIZ_2,
'url' => esc_url( tutor_utils()->tutor_dashboard_url( 'courses/my-quiz-attempts' ) ),
'active' => 'courses/my-quiz-attempts' === $active_tab ? true : false,
),
);

return $courses_tab;
Expand Down
51 changes: 25 additions & 26 deletions classes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2228,21 +2228,37 @@ public function get_completed_courses_ids_by_user( $user_id = 0 ) {
*
* @since 1.0.0
*
* @param int $user_id user id.
* @param int $user_id user id.
*
* @param boolean $with_bundle_enrolled_courses including bundle courses.
*
* @return array
*/
public function get_enrolled_courses_ids_by_user( $user_id = 0 ) {
public function get_enrolled_courses_ids_by_user( $user_id = 0, $with_bundle_enrolled_courses = true ) {
global $wpdb;
$user_id = $this->get_user_id( $user_id );
$user_id = $this->get_user_id( $user_id );

$with_bundle_enrolled_courses_clause = '';
if ( ! $with_bundle_enrolled_courses ) {
$with_bundle_enrolled_courses_clause = $wpdb->prepare(
"AND NOT EXISTS (
SELECT 1
FROM wp_postmeta pm
WHERE pm.post_id = e.ID
AND pm.meta_key = %s
)",
'_tutor_bundle_id'
);
}
$course_ids = $wpdb->get_col(
$wpdb->prepare(
"SELECT DISTINCT post_parent
FROM {$wpdb->posts}
WHERE post_type = %s
AND post_status = %s
AND post_author = %d
ORDER BY post_date DESC;
"SELECT DISTINCT e.post_parent, e.post_date
FROM {$wpdb->posts} e
WHERE e.post_type = %s
AND e.post_status = %s
AND e.post_author = %d
{$with_bundle_enrolled_courses_clause}
ORDER BY e.post_date DESC;
",
'tutor_enrolled',
'completed',
Expand Down Expand Up @@ -5576,23 +5592,6 @@ public function is_dashboard_page( $subpage = null ): bool {
);
}

/**
* Check if the current page is the frontend's course list page
*
* @since 4.0.0
*
* @return bool
*/
public function is_course_list_page(): bool {
$current_url = trailingslashit( UrlHelper::current() );
$is_course_list = $this->course_archive_page_url() === $current_url;

return apply_filters(
'tutor_is_course_list_page',
$is_course_list
);
}

/**
* Check if the current page is the part of learning area
*
Expand Down
4 changes: 2 additions & 2 deletions models/CourseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ public static function get_completed_courses_by_user( $user_id = 0, $offset = 0,
public static function get_active_courses_by_user( $user_id = 0, $offset = 0, $posts_per_page = -1, $args = array() ) {
$user_id = tutor_utils()->get_user_id( $user_id );
$course_ids = tutor_utils()->get_completed_courses_ids_by_user( $user_id );
$enrolled_course_ids = tutor_utils()->get_enrolled_courses_ids_by_user( $user_id );
$enrolled_course_ids = tutor_utils()->get_enrolled_courses_ids_by_user( $user_id, false );
$active_courses = array_diff( $enrolled_course_ids, $course_ids );

if ( count( $active_courses ) ) {
Expand Down Expand Up @@ -1308,7 +1308,7 @@ public static function get_active_courses_by_user( $user_id = 0, $offset = 0, $p
*/
public static function get_enrolled_courses_by_user( $user_id = 0, $post_status = 'publish', $offset = 0, $posts_per_page = -1, $args = array() ) {
$user_id = tutor_utils()->get_user_id( $user_id );
$course_ids = array_unique( tutor_utils()->get_enrolled_courses_ids_by_user( $user_id ) );
$course_ids = array_unique( tutor_utils()->get_enrolled_courses_ids_by_user( $user_id, false ) );

if ( count( $course_ids ) ) {
$course_post_type = tutor()->course_post_type;
Expand Down
Loading
Loading