func (VS *Server) itemToHTML(c *gin.Context, item Item) ItemHTML {
	var iHTML ItemHTML
	iHTML.ID = item.ID
	iHTML.Name = item.Name
	prod, isProd := VS.getVideoCourseByID(c, item.ID, "h_view", "itemToHTML", "prod, isProd := VS.getVideoCourseByID", false)
	if isProd {
		iHTML.Photo = "/local/video-courses/" + prod.Name + "/purchases/" + "/" + prod.Photo
		iHTML.IsTrackable = true
	} else {
		cat := VS.getCategoryByID(c, item.IDCategory, "h_view", "itemToHTML", "cat := VS.getCategoryByID")
		iHTML.CategoryName = cat.Name
		iHTML.IsTrackable = cat.IsTrackable
		tpe := VS.getCategoryTypeByID(c, cat.Type, "h_view", "itemToHTML", "tpe := VS.getCategoryTypeByID")
		iHTML.Photo = "/local/categories/" + tpe.Name + "/" + cat.Name + "/" + item.Photo
	}
	iHTML.UnitType = item.UnitType
	return iHTML
}
// This method take an Item and returns an ItemHTML, taking care if is a Video product or not
This method take an Item and returns an ItemHTML, taking care if is a Video product or not
// This method take an Item and returns an ItemHTML taking care if is a Video product or not
func (VS *Server) itemToHTML(c *gin.Context, item Item) ItemHTML {
	var iHTML ItemHTML
	iHTML.ID = item.ID
	iHTML.Name = item.Name
	prod, isProd := VS.getVideoCourseByID(c, item.ID, "h_view", "itemToHTML", "prod, isProd := VS.getVideoCourseByID", false)
	if isProd {
		iHTML.Photo = "/local/video-courses/" + prod.Name + "/purchases/" + "/" + prod.Photo
		iHTML.IsTrackable = true
	} else {
		cat := VS.getCategoryByID(c, item.IDCategory, "h_view", "itemToHTML", "cat := VS.getCategoryByID")
		iHTML.CategoryName = cat.Name
		iHTML.IsTrackable = cat.IsTrackable
		tpe := VS.getCategoryTypeByID(c, cat.Type, "h_view", "itemToHTML", "tpe := VS.getCategoryTypeByID")
		iHTML.Photo = "/local/categories/" + tpe.Name + "/" + cat.Name + "/" + item.Photo
	}
	iHTML.UnitType = item.UnitType
	return iHTML
}
func ( VS * Server ) itemToHTML ( c * gin . Context , item Item ) ItemHTML { var iHTML ItemHTML iHTML . ID = item . ID iHTML . Name = item . Name prod , isProd := VS . getVideoCourseByID ( c , item . ID , " " , " " , " " , false ) if isProd { iHTML . Photo = " " + prod . Name + " " + " " + prod . Photo iHTML . IsTrackable = true } else { cat := VS . getCategoryByID ( c , item . IDCategory , " " , " " , " " ) iHTML . CategoryName = cat . Name iHTML . IsTrackable = cat . IsTrackable tpe := VS . getCategoryTypeByID ( c , cat . Type , " " , " " , " " ) iHTML . Photo = " " + tpe . Name + " " + cat . Name + " " + item . Photo } iHTML . UnitType = item . UnitType return iHTML }
This method take an Item and returns an ItemHTML, taking care if is a Video product or not
This method take an Item and returns an ItemHTML taking care if is a Video product or not