orderinquiryview에서 shop_oder_table 값 불러오기 채택완료

https://sir.kr/yc5_tip/183 해당 팁을 참고하여 주문 시 새로운 필드 ct_msg 에 값을 넣는 기능을 추가하였습니다.

ct_msg를 하단에 희망부분(주문자정보) 에 넣고 싶은데 sod_opt에 넣었을땐 출력이 잘 되는데 

주문자 정보에는 출력이 안되는 이유를 도통 모르겠습니다.

조언좀 부탁드립니다

 

Copy
<h1>주문상세내역</h1>

    <div id="sod_fin" class="clear">

    <div id="sod_fin_no">주문번호 <strong><?php echo $od_id; ?></strong></div>

    <section id="sod_fin_list">

        <h2>주문하신 상품</h2>

 

        <?php

        $st_count1 = $st_count2 = 0;

        $custom_cancel = false;

 

        $sql = " select it_id, it_name, ct_send_cost, ct_msg, it_sc_type

                    from {$g5['g5_shop_cart_table']}

                    where od_id = '$od_id'

                    group by it_id

                    order by ct_id ";

        $result = sql_query($sql);

        ?>

       

        <div class="tbl_head03 tbl_wrap">

            <table>

                <thead>

                <tr class="th_line">

                    <th scope="col" id="th_itname">상품명</th>

                    <th scope="col" id="th_itqty">총수량</th>

                    <th scope="col" id="th_itprice">판매가</th>

                    <th scope="col" id="th_itpt">포인트</th>

                    <th scope="col" id="th_itsd">배송비</th>

                    <th scope="col" id="th_itsum">소계</th>

                    <th scope="col" id="th_itst">상태</th>

                </tr>

                </thead>

                <tbody>

                <?php

                for($i=0; $row=sql_fetch_array($result); $i++) {

                    $image = get_it_image($row['it_id'], 55, 55);

   

                    $sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, ct_msg, io_type, io_price

                                from {$g5['g5_shop_cart_table']}

                                where od_id = '$od_id'

                                  and it_id = '{$row['it_id']}'

                                order by io_type asc, ct_id asc ";

                    $res = sql_query($sql);

                    $rowspan = sql_num_rows($res) + 1;

   

                    // 합계금액 계산

                    $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,

                                    SUM(ct_qty) as qty

                                from {$g5['g5_shop_cart_table']}

                                where it_id = '{$row['it_id']}'

                                  and od_id = '$od_id' ";

                    $sum = sql_fetch($sql);

   

                    // 배송비

                    switch($row['ct_send_cost'])

                    {

                        case 1:

                            $ct_send_cost = '착불';

                            break;

                        case 2:

                            $ct_send_cost = '무료';

                            break;

                        default:

                            $ct_send_cost = '선불';

                            break;

                    }

   

                    // 조건부무료

                    if($row['it_sc_type'] == 2) {

                        $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id);

   

                        if($sendcost == 0)

                            $ct_send_cost = '무료';

                    }

   

                    for($k=0; $opt=sql_fetch_array($res); $k++) {

                        if($opt['io_type'])

                            $opt_price = $opt['io_price'];

                        else

                            $opt_price = $opt['ct_price'] + $opt['io_price'];

   

                        $sell_price = $opt_price * $opt['ct_qty'];

                        $point = $opt['ct_point'] * $opt['ct_qty'];

   

                        if($k == 0) {

                ?>

                <?php } ?>

                <tr>

                    <td headers="th_itopt" class="td_prd">

                        <div class="sod_img"><?php echo $image; ?></div>

                        <div class="sod_name">

                            <a href="<?php echo shop_item_url($row['it_id']); ?>"><?php echo $row['it_name']; ?></a><br>

                            <div class="sod_opt">

<?php echo $row['ct_msg']; }?>// ct_msg 정상 출력 되고있음.

<?php echo get_text($opt['ct_option']); ?></div>

                        </div>

                    </td>

.

.

.

.

.

.

        <section id="sod_fin_orderer">

            <h3>주문자 정보</h3>

 

            <div class="tbl_head01 tbl_wrap">

                <div>

                <dl>

                    <dt>주문자명</dt>

                    <dd><?php echo get_text($od['od_name']); ?></dd>

                </dl>

                <dl>

                    <dt>전화번호</dt>

                    <dd><?php echo get_text($od['od_tel']); ?></dd>

                </dl>

                <dl>

                    <dt>주 소</dt>

                    <dd><?php echo get_text(sprintf("(%s%s)", $od['od_zip1'], $od['od_zip2']).' '.print_address($od['od_addr1'], $od['od_addr2'], $od['od_addr3'], $od['od_addr_jibeon'])); ?></dd>

                </dl>

                </div>

            </div>

        </section>

       

        <section id="sod_fin_receiver">

            <h3><?php echo $row['ct_msg']; ?></h3> // 출력 희망 부분

 

            <div class="tbl_head01 tbl_wrap">

                <div>

                <dl>

                    <dt>수령인명</dt>

                    <dd><?php echo get_text($od['od_b_name']); ?></dd>

                </dl>

                <dl>

                    <dt>전화번호</dt>

                    <dd><?php echo get_text($od['od_b_tel']); ?></dd>

                </dl>

                <dl>

                    <dt>주 소</dt>

                    <dd><?php echo get_text(sprintf("(%s%s)", $od['od_b_zip1'], $od['od_b_zip2']).' '.print_address($od['od_b_addr1'], $od['od_b_addr2'], $od['od_b_addr3'], $od['od_b_addr_jibeon'])); ?></dd>

                </dl>

                <?php

                // 희망배송일을 사용한다면

                if ($default['de_hope_date_use'])

                {

                ?>

                <dl>

                    <dt>희망배송일</dt>

                    <dd><?php echo substr($od['od_hope_date'],0,10).' ('.get_yoil($od['od_hope_date']).')' ;?></dd>

                </dl>

                <?php }

                if ($od['od_memo'])

                {

                ?>

                <dl>

                    <dt>전하실 말씀</dt>

                    <dd><?php echo conv_content($od['od_memo'], 0); ?></dd>

                </dl>

                <?php } ?>

                </div>

            </div>

        </section>

답변 1개

채택된 답변
+20 포인트

아래의 내용을 한번 참고를 해보시겠어요..

 

 

<section id="sod_fin_receiver">
    <?php
    // ct_msg 값을 별도로 조회
    $sql_msg = "SELECT ct_msg FROM {$g5['g5_shop_cart_table']} WHERE od_id = '$od_id' AND ct_msg != '' LIMIT 1";
    $msg_result = sql_query($sql_msg);
    $msg_row = sql_fetch_array($msg_result);
    ?>
    <h3><?php echo $msg_row['ct_msg']; ?></h3> <!-- 여기서 출력 -->
    
    <div class="tbl_head01 tbl_wrap">
        <!-- 나머지 코드 -->
    </div>
</section>

 

 

 

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

답변에 대한 댓글 1개

늘 감사드립니다 제이앤님! 좋은 하루 되세요!

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

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

로그인
🐛 버그신고