상품이미지 링크

상품이미지 링크

QA

상품이미지 링크

본문

지금은 제품명을 클릭할때만 상세페이지로 넘어가는데

이미지에도 링크를 설정해 동일하게 상세페이지로 넘어 가게 하고 싶습니다

아래의 소스 아무리 보아도 모르겠습니다 초보라서요... 

 

<!-- 상품유형 30 시작 { -->
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
    if ($i == 0) {
        if ($this->css) {
            echo "<ul class=\"{$this->css}\">\n";
        } else {
            echo "<ul class=\"sct sct_30\">\n";
        }
    }

    if ($i % $this->list_mod == 0)
        $sct_clear = ' sct_clear';
    else
        $sct_clear = '';

    echo "<li class=\"sct_li{$sct_clear}\">\n";

    if ($this->href) {
        echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
    }

    if ($this->view_it_img) {
        echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
    }

    if ($this->href) {
        echo "</a></div>\n";
    }

    if ($this->href) {
        echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_tit\">\n";
    }

    if ($this->view_it_name) {
        echo stripslashes($row['it_name'])."</a>\n";
    }

    if ($this->view_it_cust_price || $this->view_it_price) {

        echo "<span class=\"sct_cost\">\n";
if ($this->view_it_model) {
    echo "<div class=\"sct_txt\">".stripslashes($row['it_model'])."</div>\n";
}

        if ($this->view_it_price) {
            echo display_price(get_price($row), $row['it_tel_inq'])."\n";
        }

        echo "</span>\n";

    }
    if ($this->href) {
        echo "</div>\n";
    }

     echo"<div class=\"sct_cart\">
            <div class=\"sct_cart_btn\"  style=\"width:{$this->img_width}px;height:{$this->img_height}px\">
                <button type=\"button\" class=\"btn_wish\" data-it_id=\"{$row['it_id']}\">위시</button>
                <button type=\"button\" class=\"btn_cart\" data-it_id=\"{$row['it_id']}\">장바구니</button>
            </div>
            <div class=\"sct_cart_op\"  style=\"width:{$this->img_width}px;height:{$this->img_height}px\"></div>
        </div>\n";

    echo"</li>\n";
}

if ($i > 0) echo "</ul>\n";

if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>

어디를 수정해야 될까요?

이 질문에 댓글 쓰기 :

답변 2

 if ($this->href) {
        echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
    }

    if ($this->view_it_img) {
        echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
    }

    if ($this->href) {
        echo "</a></div>\n";
    }

 

여기 보시면 이미지 위아래로 A링크가 들어있는데욤...

저부분을 살펴보시길 바랍니다.. 소스상에선 이미 링크가 들어있습니다.

그런데 왜? 링크가 안되지요?

소스상에서요.. 링크 태그가
 if ($this->href) {
        echo "</a></div>\n";
    }

    if ($this->href) {
        echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_tit\">\n";
    }
이렇게 되어있는 데요..
첫 if 문을 일단 주석처리하시고 해 보시면 어떨까요?

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

회원로그인

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