상품 상세 페이지에 상품 이미지에 alt 넣어야 하는데요.
본문
상품 상세 페이지에 상품 이미지에 alt =에 제목이 나와야 하는데 안되네요.
.$img.'
이렇게만 되어 있어서요.
<div id="sit_pvi">
<div id="sit_pvi_big">
<?php
$big_img_count = 0;
$thumbnails = array();
for($i=1; $i<=10; $i++) {
if(!$it['it_img'.$i])
continue;
$img = get_it_thumbnail($it['it_img'.$i], $default['de_mimg_width'],$alt['it_name'], $default['de_mimg_height']);
if($img) {
// 썸네일
$thumb = get_it_thumbnail($it['it_img'.$i], 70, 70);
$thumbnails[] = $thumb;
$big_img_count++;
echo '<a href="'.G5_SHOP_URL.'/largeimage.php?it_id='.$it['it_id'].'&no='.$i.'" title="새창 열림" target="_blank" class="popup_item_image">'.$img.'</a>';
}
}
if($big_img_count == 0) {
echo '<img src="'.G5_SHOP_URL.'/img/no_image.gif" alt="">';
}
?>
<a href="<?php echo G5_SHOP_URL; ?>/largeimage.php?it_id=<?php echo $it['it_id']; ?>&no=1" target="_blank" title="새창 열림" id="popup_item_image" class="popup_item_image"><i class="fa fa-search-plus" aria-hidden="true"></i><span class="sound_only">확대보기</span></a>
</div>
<?php
// 썸네일
$thumb1 = true;
$thumb_count = 0;
$total_count = count($thumbnails);
if($total_count > 0) {
echo '<ul id="sit_pvi_thumb">';
foreach($thumbnails as $val) {
$thumb_count++;
$sit_pvi_last ='';
if ($thumb_count % 5 == 0) $sit_pvi_last = 'class="li_last"';
echo '<li '.$sit_pvi_last.'>';
echo '<a href="'.G5_SHOP_URL.'/largeimage.php?it_id='.$it['it_id'].'&no='.$thumb_count.'" target="_blank" title="새창 열림" class="popup_item_image img_thumb">'.$val.'<span class="sound_only"> '.$thumb_count.'번째 이미지 새창</span></a>';
echo '</li>';
}
echo '</ul>';
}
?>
</div>
답변 1
$img에는 alt가 들어 가지만
$thumbnail에는 안 들어 갑니다.
lib/shop.lib.php를 보시면
// 상품이미지 썸네일 생성
function get_it_thumbnail($img, $width, $height=0, $id='', $is_crop=false)
{
...
...
$str = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'"';
if($id)
$str .= ' id="'.$id.'"';
$str .= ' alt="">';
}
return $str;
}
파라미터를 추가해서 alt를 넣어 주시면 되겠네요.