영카트 문의드립니다.

영카트 문의드립니다.

QA

영카트 문의드립니다.

답변 5

본문

영카트 문의드립니다.

영카트에서 아래 코드가 ?ca_id=aa 일때는 안보이게 처리 하고 싶습니다.

어떻게 처리하면 될까요?


if ($this->view_it_cust_price && $row['it_cust_price']) {
    $discount_rate = round(($row['it_cust_price'] - $row['it_price']) / $row['it_cust_price'] * 100);
  if($discount_rate > 0) echo "<div><span style='color:red; font-size:20px;';>$discount_rate%▼ </span> {$row['it_basic']}</div>";
}

이 질문에 댓글 쓰기 :

답변 5

다른 코드를 보면 $row['it_id'] 로 사용하고 있잖아요

if ($this->view_it_cust_price && $row['it_cust_price'] && $ca_id !== '3011') {

==>

if ($this->view_it_cust_price && $row['it_cust_price'] && $row['ca_id'] !== '3011') {


if ($this->view_it_cust_price && $row['it_cust_price'] && $ca_id !== 'aa') {
    $discount_rate = round(($row['it_cust_price'] - $row['it_price']) / $row['it_cust_price'] * 100);
  if($discount_rate > 0) echo "<div><span style='color:red; font-size:20px;';>$discount_rate%▼ </span> {$row['it_basic']}</div>";
}

아래 코드를 참고해 보시겠어요..

 

 

<?php
if ($ca_id !== 'aa') {  // 카테고리 ID가 'aa'가 아닐 때만 실행
    if ($this->view_it_cust_price && $row['it_cust_price']) {
        $discount_rate = round(($row['it_cust_price'] - $row['it_price']) / $row['it_cust_price'] * 100);
        if ($discount_rate > 0) {
            echo "<div><span style='color:red; font-size:20px;';>$discount_rate%▼ </span> {$row['it_basic']}</div>";
        }
    }
}
?>

 

 

 

전체 소스 입니다. 다시한번 확인해 주세요~~

ㅜㅜㅜㅜ



<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
    if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
        if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
        else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
        else $sct_last = '';
    } else { // 1줄 이미지 : 1개
        $sct_last = 'sct_clear';
    }
    if ($i == 1) {
        if ($this->css) {
            echo "<ul class=\"{$this->css}\">\n";
        } else {
            echo "<ul class=\"sct sct_10\">\n";
        }
    }
    echo "<li class=\"sct_li {$sct_last}\" style=\"width:{$this->img_width}px\">\n";
    echo "<div class=\"sct_img\">\n";
    if ($this->href) {
        echo "<a href=\"{$this->href}{$row['it_id']}\">\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>\n";
    }
    echo "</div>\n";
    if ($this->view_it_id) {
        echo "<div class=\"sct_id\"><".stripslashes($row['it_id'])."></div>\n";
    }
    if ($this->href) {
        echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\">\n";
    }
    
if ($this->view_it_cust_price && $row['it_cust_price'] && $ca_id !== '3011') {
    $discount_rate = round(($row['it_cust_price'] - $row['it_price']) / $row['it_cust_price'] * 100);
  if($discount_rate > 0) echo "<div><span style='color:red; font-size:20px;';>$discount_rate%▼ </span> {$row['it_basic']}</div>";
}

    if ($this->view_it_name) {
        //echo mb_strimwidth($row['it_name'],0,30, '...','utf-8')."\n";
        echo $row['it_name']."\n";
    }
    if ($this->href) {
        echo "</a></div>\n";
    }

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로