영카트 시중가 입력 안했을 때 할인율 안나오게요~ 채택완료

2년 전 조회 2,172

Copy
echo "<div class=\"sct_bottom\">\n";

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

            echo "<div class=\"sct_cost\">\n";
            if ($this->view_it_price) {
                echo display_price(get_price($row), $row['it_tel_inq'])."\n";
            }
            //-------------------------------------------------------------------------
            //-- 아이스크림S10.0.2
            //-- 시중가와 판매가가 다른경우 시중가표시(취소선으로표시)
            //-- 할인율표시
            //-- style.css 건드리지 않고, 직접 style 적용
            //-------------------------------------------------------------------------
            if (get_price($row) != $row['it_cust_price']) {
                echo "<strike style=\"color:#777;font-weight:normal;\">".number_format($row['it_cust_price'])." </strike>\n";
                
                // 할인율표시 시작
                $sale_per = '<span style="color:#FF6600;">'.ceil((1 - (get_price($row)/$row['it_cust_price']))*100).'%</span>'; //할인율계산
                    echo str_replace('-', '', $sale_per); //할인율표시(앞에 - 표시삭제)
            }
            //-------------------------------------------------------------------------
            if ($this->view_it_cust_price && $row['it_cust_price']) {
                echo "<span class=\"sct_dict\">".display_price($row['it_cust_price'])."</span>\n";
            }
            echo "</div>\n";
        }

 

list.10.skin.php

 

여기서 수정했는데요

입력 안한곳도 다 나와서요~

시중가 입력했을때만 할인율 나오게 할려면 어떻게 수정해야하나요?

디자이너에요~

 

33102762_1688532110.0262.png

 

 

답변 2개

채택된 답변
+20 포인트

아래 처럼 적용해보시겠어요?

 

수정전

Copy
if (get_price($row) != $row['it_cust_price']) {

 

수정후

Copy
if (get_price($row) != $row['it_cust_price'] && $row['it_cust_price'] > 0) {
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

if (get_price($row) != $row['it_cust_price']) { 를

 

if ((int)get_price($row) != (int)$row['it_cust_price']) { 로 한번 해보세요.
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고