테스트 사이트 - 개발 중인 베타 버전입니다

레벨별 단가 채택완료

7년 전 조회 2,281

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

</p>

<p><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></p>

<p>

 

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

 

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

 

           echo "                     ".number_format($it['it_price'])."                  ";

 

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

 

 

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

답변 1개

복스리
7년 전

/lib/shop.lib.php

여기 함수 보시면

 

get_price 이란 함수가 있습니다.

</p>

<p>function get_price($it)

{

    global $member;</p>

<p>    if ($it['it_tel_inq']) return '전화문의';</p>

<p>    if($member[mb_level] ==2 )</p>

<p>      $price = $it['it_price1'];</p>

<p>   else if($member[mb_level] ==3 )</p>

<p>      $price = $it['it_price2'];</p>

<p>   else if($member[mb_level] ==4 )</p>

<p>      $price = $it['it_price3'];</p>

<p>    return (int)$price;

}</p>

<p> </p>

<p>

 

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

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

로그인 후 평가할 수 있습니다

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

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

로그인