시중가격 미입력시 할인율 표기

시중가격 미입력시 할인율 표기

QA

시중가격 미입력시 할인율 표기

본문


 
if ($this->view_it_price) {
        echo "<div class=\"sct_cost\">\n";
        echo display_price(get_price($row), $row['it_tel_inq'])."\n";
        
        echo "<span class=\"sct_vjtpsxm\">".$sale_per=ceil(( ( $row['it_cust_price']-get_price($row) ) /$row['it_cust_price'])*100).'% Off' ;
        
        echo "</span>\n";
      
        echo "</div>\n";
        }
      
            echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
    echo "</div></li>\n";
}
 

 

 

3554187964_1595339087.7095.png

 

list.10.skin.php

 

시중가격 미입력시에  0원 0% off 가 안나오게 하고싶습니다. 

 

 

--------------------------------------------------------------------------------------------------------

 

main.10.skin.php  메인 에서는 잘 됩니다.

 


if ($this->view_it_price) {
            // 가격 추가
            if ($this->view_it_cust_price && $row['it_cust_price']) {
                echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
            }
            echo "<div class=\"sct_cost\">\n";
            echo display_price(get_price($row), $row['it_tel_inq'])."\n";
            // 할인율 추가 2020.06.24
            if ($this->view_it_cust_price && $row['it_cust_price']) {
            echo "<span class=\"sct_vjtpsxm\">".$sale_per=ceil(( ( $row['it_cust_price']-get_price($row) ) /$row['it_cust_price'])*100).'% Off' ;
            // echo "<span class=\"sct_vjtpsxm\">".$sale_per=ceil(((get_price($row)-$row['it_cust_price'])/$row['it_cust_price'])*100).'%';
            echo "</span>\n";
        }
        //
             echo "</div>\n";
            }
        echo "</div></li>\n";
    }
 

 

3554187964_1595339233.4416.png

 

 

 

이 질문에 댓글 쓰기 :

답변 1


if ($this->view_it_price) {
        echo "<div class=\"sct_cost\">\n";
        echo display_price(get_price($row), $row['it_tel_inq'])."\n";
        if ($this->view_it_cust_price && $row['it_cust_price']) {
          echo "<span class=\"sct_vjtpsxm\">".$sale_per=ceil(( ( $row['it_cust_price']-get_price($row) ) /$row['it_cust_price'])*100).'% Off' ;
        }        
        echo "</span>\n";      
        echo "</div>\n";
        }
      if ($this->view_it_cust_price && $row['it_cust_price']) {
            echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
      }
    echo "</div></li>\n";
}

답변 감사합니다.  적용하니, 시중 가격및 할인율까지 모두 안나오네요 ..

영카트 기본으로 하면 적용이 되니, 소스상으론 문제가 없어 보입니다.



아래 소스가 문제가 있는거 같은데, 찾기가 쉽지 않네요


<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_CSS_URL.'/style.css">', 0);
add_javascript('<script src="'.G5_THEME_JS_URL.'/jquery.shop.list.js"></script>', 10);
?>

<?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script>
    // 사용할 앱의 Javascript 키를 설정해 주세요.
    Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script>
<?php } ?>
<div class="sct-size">
    <button type="button" class="btn-size" id="btn-big">이미지크게보기</button>
    <button type="button" class="btn-size active" id="btn-small">이미지작게보기</button>
</div>
<!-- 상품진열 10 시작 { -->
<div class="sct_wrap" >
<?php
$li_width = intval(100 / $this->list_mod);
$li_width_style = ' style="width:'.$li_width.'%;"';

for ($i=0; $row=sql_fetch_array($result); $i++) {
    if ($i == 0) {
        if ($this->css) {
            echo "<ul id=\"sct_wrap\" class=\"{$this->css}\">\n";
        } else {
            echo "<ul id=\"sct_wrap\" class=\"sct sct_10\">\n";
        }
    }

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

    echo "<li class=\"sct_li\"><div class=\"sct_li_wr\">\n";

    echo "<div class=\"img_wr\">";

    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";
    }

    echo "<div class=\"sct_btn\">
            <div class=\"sct_cart_btn\">
                <button type=\"button\" class=\"btn_cart\" data-it_id=\"{$row['it_id']}\"><span class=\"sound_only\">장바구니</span><i class=\"fa fa-shopping-cart\" aria-hidden=\"true\"></i></button>
                <button type=\"button\" class=\"btn_wish\" data-it_id=\"{$row['it_id']}\"><span class=\"sound_only\">위시리스트</span><i class=\"fa fa-heart\" aria-hidden=\"true\"></i></button>
            </div>
        </div>\n";

    echo "</div>";

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

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

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

    if ($this->view_it_price) {
            echo "<div class=\"sct_cost\">\n";
            echo display_price(get_price($row), $row['it_tel_inq'])."\n";
            if ($this->view_it_cust_price && $row['it_cust_price']) {
              echo "<span class=\"sct_vjtpsxm\">".$sale_per=ceil(( ( $row['it_cust_price']-get_price($row) ) /$row['it_cust_price'])*100).'% Off' ;
            }
            echo "</span>\n";
            echo "</div>\n";
            }
          if ($this->view_it_cust_price && $row['it_cust_price']) {
                echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
          }
        echo "</div></li>\n";
    }

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

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

</div>
<style>
.sct_discount{
    /* margin-top:0; */
}
</style>
<script>

    $(".sct-size button").click(function () {
        $(".sct-size button").removeClass("active");
        $(this).addClass("active");
    });
    $("#btn-small").click(function () {
        $(".sct_wrap").removeClass("big").addClass("small");
    });
    $("#btn-big").click(function () {
        $(".sct_wrap").removeClass("small").addClass("big");
    });

</script>
<!-- } 상품진열 10 끝 -->

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

회원로그인

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