상품구매할때 할인율을 표기해보려하는데 몇 시간째 헤메이고있네요 ㅠㅠ

상품구매할때 할인율을 표기해보려하는데 몇 시간째 헤메이고있네요 ㅠㅠ

QA

상품구매할때 할인율을 표기해보려하는데 몇 시간째 헤메이고있네요 ㅠㅠ

본문

3032307430_1563617192.994.png

--------------- item.form.skin.php -----------------

-- 생략 --

                <th scope="row">시중가격</th>
         <td><?php echo "<strike><span class='sct_cust_price'>".display_price($it['it_cust_price'])."</span></strike>"?></td>

            </tr>
            <?php } // 시중가격 끝 ?>

            <tr>
                <th scope="row">판매가격</th>
                <td>
     <strong><?php echo display_price(get_price($it)); ?></strong>

>> 대략 이 아래쪽에 소스를 짜서 넣어주면 될것같아보이는데 어렵네요 ㅠㅠ
                    <input type="hidden" id="it_price" value="<?php echo get_price($it); ?>">
                </td>
            </tr>
            <?php } ?>

            <?php

--생략--

위 이미지와 같이 69% 할인율을 추가해보고 싶습니다.

영카트 베이직 스킨을 사용중인데 저 부분이 어렵네요 ㅠ.ㅠ

이 질문에 댓글 쓰기 :

답변 2

<?php
if ($it['it_cust_price'] && $it['it_price']) {
    echo round(($it['it_cust_price'] - $it['it_price']) / $it['it_cust_price'] * 100)."%";
}
?>

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

회원로그인

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