/** * Get a course * * @param int course ID * @return StorefrontModelCourse Instance of a product */ public function getCourse($courseId) { $course = \Components\Storefront\Models\Product::getInstance($courseId); // check if this is a course if (!$course instanceof Course) { throw new \Exception(Lang::txt('Invalid course')); } $course->getCollections(); $course->getSkus(); return $course; }