상품 상세 페이지에 상품 이미지에 alt 넣어야 하는데요.

상품 상세 페이지에 상품 이미지에 alt 넣어야 하는데요.

QA

상품 상세 페이지에 상품 이미지에 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를 넣어 주시면 되겠네요.

답변을 작성하시기 전에 로그인 해주세요.
전체 16,775
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT