/** * Returns HTML code of product image badge. * * @param array $image Image data array containing elements 'badge_type' and, optionally, 'badge_code' (for custom badges). * @return string */ public static function getImageBadgeHtml($image) { if (!isset($image['badge_type'])) { return ''; } if (shopProductImagesModel::isCustomBadgeType($image['badge_type'])) { return isset($image['badge_code']) ? $image['badge_code'] : ''; } return shopProductImagesModel::getBadgeCode($image['badge_type']); }