diff --git a/resources/js/components/cards/course-card-1.tsx b/resources/js/components/cards/course-card-1.tsx index c25a5583..948a1eb2 100644 --- a/resources/js/components/cards/course-card-1.tsx +++ b/resources/js/components/cards/course-card-1.tsx @@ -18,6 +18,7 @@ const CourseCard1 = ({ course, viewType = 'grid', className, wishlists }: Props) const { user } = props.auth; const { translate } = props; const { button, frontend, common } = translate; + const showWishlist = props.system.fields?.show_student_wishlist !== false; const isWishlisted = wishlists?.find((wishlist) => wishlist.course_id === course.id); const currency = systemCurrency(props.system.fields['selling_currency']); @@ -55,7 +56,7 @@ const CourseCard1 = ({ course, viewType = 'grid', className, wishlists }: Props) - {wishlists && ( + {wishlists && showWishlist && ( diff --git a/resources/js/components/cards/course-card-2.tsx b/resources/js/components/cards/course-card-2.tsx index e46ae70d..fdfbcf6e 100644 --- a/resources/js/components/cards/course-card-2.tsx +++ b/resources/js/components/cards/course-card-2.tsx @@ -17,6 +17,7 @@ const CourseCard2 = ({ course, className, wishlists }: Props) => { const { props } = usePage(); const { user } = props.auth; const { button, common, frontend } = props.translate; + const showWishlist = props.system.fields?.show_student_wishlist !== false; const isWishlisted = wishlists?.find((wishlist) => wishlist.course_id === course.id); const currency = systemCurrency(props.system.fields['selling_currency']); @@ -52,7 +53,7 @@ const CourseCard2 = ({ course, className, wishlists }: Props) => { - {wishlists && ( + {wishlists && showWishlist && ( diff --git a/resources/js/components/cards/course-card-6.tsx b/resources/js/components/cards/course-card-6.tsx index 9bee17c3..7e175d3c 100644 --- a/resources/js/components/cards/course-card-6.tsx +++ b/resources/js/components/cards/course-card-6.tsx @@ -17,6 +17,7 @@ const CourseCard6 = ({ course, type = 'grid', className, wishlists }: Props) => const { props } = usePage(); const { user } = props.auth; const { button, common, frontend } = props.translate; + const showWishlist = props.system.fields?.show_student_wishlist !== false; const isWishlisted = wishlists?.find((wishlist) => wishlist.course_id === course.id); const currency = systemCurrency(props.system.fields['selling_currency']); @@ -54,7 +55,7 @@ const CourseCard6 = ({ course, type = 'grid', className, wishlists }: Props) => - {wishlists && ( + {wishlists && showWishlist && ( diff --git a/resources/js/components/exam/exam-card-1.tsx b/resources/js/components/exam/exam-card-1.tsx index 5f9e728d..f0e2ba2f 100644 --- a/resources/js/components/exam/exam-card-1.tsx +++ b/resources/js/components/exam/exam-card-1.tsx @@ -20,6 +20,7 @@ const ExamCard1 = ({ exam, variant = 'default', viewType = 'grid', onAddToCart, const { props } = usePage(); const { translate } = props; const { common } = translate; + const showWishlist = props.system.fields?.show_student_wishlist !== false; const isCompact = variant === 'compact'; const examUrl = route('exams.details', { slug: exam.slug, id: exam.id }); @@ -97,7 +98,7 @@ const ExamCard1 = ({ exam, variant = 'default', viewType = 'grid', onAddToCart,
- {onAddToWishlist && ( + {showWishlist && onAddToWishlist && ( + {showWishlist && ( + + )} diff --git a/resources/js/pages/exams/partials/exam-preview.tsx b/resources/js/pages/exams/partials/exam-preview.tsx index 36eee9f8..d120fee4 100644 --- a/resources/js/pages/exams/partials/exam-preview.tsx +++ b/resources/js/pages/exams/partials/exam-preview.tsx @@ -10,6 +10,7 @@ const CoursePreview = () => { const { auth, exam, system, wishlist, enrollment, translate } = usePage().props; const { frontend } = translate; const currency = systemCurrency(system.fields['selling_currency']); + const showWishlist = system.fields?.show_student_wishlist !== false; const handleWishlist = () => { if (wishlist) { @@ -75,9 +76,11 @@ const CoursePreview = () => { )} - + {showWishlist && ( + + )} {exam.pricing_type === 'free' ? (