레벨별 단가

레벨별 단가

QA

레벨별 단가

본문

얼마전에 질문했었는데 해결되지 않아 또 질문 드려요 장바구니에 상세보기창이 있는데 상세보기란 php를 새로 작성해서 넣은거라 그런지 얼마전에 답변으로 받은 링크로 적용해봐도 레벨별 가격으로 보이지 않더군요


<p style="font-size:14px;margin:0 0 5px 5px;font-weight:900;color:green">주문</p>
<div id="sit_sel_option">
    <ul id="sit_opt_added">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <th width="20%">(-)</th>
                <th width="20%">(-)</th>
                <th width="20%">수량</th>
                <th width="20%">단가</th>
                <th width="20%">합계</th>
            </tr>
        <?php
        for($i=0; $i < count($a1cnt); $i++) {
            $a1 = $a1 + $a1cnt[$i];
            $sphcyl = explode("/", $a1text[$i]);
            echo "<tr align='center'>";
            echo "<td>".$sphcyl[0]."</td>";
            echo "<td>".$sphcyl[1]."</td>";
            echo "<td>".$a1cnt[$i]."</td>";
            echo "<td>
                    ".number_format($it['it_price'])."
                 </td>";
            echo "<th>".number_format($a1cnt[$i]*$it['it_price'])."</th>";
            echo "</tr>";
        }
        ?>
            <tr>
                <th></th>
                <th></th>
                <th><?php echo $a1;?>개</th>
                <th colspan="2"><p style="text-align:right;margin:5px 20px;color:green"><?php echo number_format($row['a1price']);?>원</p></th>
            </tr>
        </table>
    </ul>
</div>

 

단가부분을 수정하고 싶어서요

 

여기 부분에 if문을 작성 하면 될거같은데 

 

           echo "<td>
                    ".number_format($it['it_price'])."
                 </td>";

 

더 좋은 방법이 있다면 가르쳐주시면 감사하겠습니다ㅠㅜ 꼭 필요해서요

 

 

이 질문에 댓글 쓰기 :

답변 1

/lib/shop.lib.php

여기 함수 보시면

 

get_price 이란 함수가 있습니다.


function get_price($it)
{
    global $member;
    if ($it['it_tel_inq']) return '전화문의';
    if($member[mb_level] ==2 )
      $price = $it['it_price1'];
   else if($member[mb_level] ==3 )
      $price = $it['it_price2'];
   else if($member[mb_level] ==4 )
      $price = $it['it_price3'];
    return (int)$price;
}
 

 

위 예제 처럼 it_price1 ~ it_price3까지 필드를 만들어놓구 각 레벨별로

로그인했을때..해당 레벨에 맞게 금액이 나오도록 해주면 될꺼 같습니다.

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

회원로그인

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