@php if (!$course) { return; } $currency = $course?->coursePrice->currency ?? 'USD-$'; $currencySymbol = get_currency_symbol($currency); $translations = $translations ?? parse_translation($course); $badgeText = $course?->courseSetting?->is_free ? translate('Free') : (isset($course?->coursePrice) && $course?->coursePrice?->discount_flag == 1 && $course?->coursePrice?->discount_period != '' && dateCompare($course?->coursePrice?->discount_period) ? $currencySymbol . dotZeroRemove($course?->coursePrice?->discounted_price ?? 0) : $currencySymbol . dotZeroRemove($course?->coursePrice?->price ?? 0)); $coursePrice = $course->coursePrice ?? null; $imagePath = 'lms/courses/thumbnails'; $defaultThumbnail = 'lms/frontend/assets/images/370x396.svg'; $thumbnail = !empty($course?->thumbnail) && fileExists($imagePath, $course->thumbnail) ? asset('storage/' . $imagePath . '/' . $course->thumbnail) : asset($defaultThumbnail); @endphp