주문 상세내역에서 후기 버튼을 만드는데 상품 아이디 값을 못가져오네요

주문 상세내역에서 후기 버튼을 만드는데 상품 아이디 값을 못가져오네요

QA

주문 상세내역에서 후기 버튼을 만드는데 상품 아이디 값을 못가져오네요

답변 4

본문

사용자 주문내역 리스트에서 바로 상품평을 작성하게끔 작업중인데

상품 아이디 값을 못가져 오네요

고수님들의 도움 부탁드립니다

 

적용버전은 5.4 입니다

 

<?
        $sql = " select it_id
                    from {$g5['g5_shop_cart_table']}
                    where od_id = '$od_id'
                    order by ct_id limit 1";
        $ct = sql_fetch($sql);
?>

<a href="./itemuseform.php?it_id=<?php echo $row['it_id'] ?>" class="btn02 itemuse_form"><?php echo $row['it_name'] ?> 사용후기 쓰기</a>

 

 

이 질문에 댓글 쓰기 :

답변 4

$ct에 담았으니, $row 대신  $ct 사용하셔야...

혹시 <a href="./itemuseform.php?it_id=<?php echo $ct['it_id'] ?>" class="btn02 itemuse_form"><?php echo $ct['it_name'] ?>후기작성</a> 요렇게 변경하란 말씀이시죠..  마찬가지네요 ㅠㅠ

전체 소스입니다 


<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
// 테마에 orderinquiry.sub.php 있으면 include
if(defined('G5_THEME_SHOP_PATH')) {
    $theme_inquiry_file = G5_THEME_SHOP_PATH.'/orderinquiry.sub.php';
    if(is_file($theme_inquiry_file)) {
        include_once($theme_inquiry_file);
        return;
        unset($theme_inquiry_file);
    }
}
?>
<!-- 주문 내역 목록 시작 { -->
<?php if (!$limit) { ?>총 <?php echo $cnt; ?> 건<?php } ?>
<div class="tbl_head03 tbl_wrap">
    <table>
    <thead>
    <tr>
        <th scope="col">주문서번호</th>
        <th scope="col">주문일시</th>
        <th scope="col">상품수</th>
        <th scope="col">주문금액</th>
        <th scope="col">입금액</th>
        <th scope="col">미입금액</th>
        <th scope="col">상태</th>
        <th scope="col">후기작성</th>
    </tr>
    </thead>
    <tbody>
    <?php
    $sql = " select *
               from {$g5['g5_shop_order_table']}
              where mb_id = '{$member['mb_id']}'
              order by od_id desc
              $limit ";
    $result = sql_query($sql);
    
    for ($i=0; $row=sql_fetch_array($result); $i++)
    {
        $uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
        switch($row['od_status']) {
            case '주문':
                $od_status = '<span class="status_01">장착예약</span>';
                break;
            case '입금':
                $od_status = '<span class="status_02">입금완료</span>';
                break;
            case '준비':
                $od_status = '<span class="status_03">상품준비중</span>';
                break;
            case '배송':
                $od_status = '<span class="status_04">상품배송</span>';
                break;
            case '완료':
                $od_status = '<span class="status_05">배송완료</span>';
                break;
            default:
                $od_status = '<span class="status_06">주문취소</span>';
                break;
        }
    ?>
<?
        $sql = " select it_id
                    from {$g5['g5_shop_cart_table']}
                    where od_id = '$od_id'
                    order by ct_id limit 1";
        $ct = sql_fetch($sql);
?>
    <tr>
        <td>
            <a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>"><?php echo $row['od_id']; ?></a>
        </td>
        <td><?php echo substr($row['od_time'],2,14); ?> (<?php echo get_yoil($row['od_time']); ?>)</td>
        <td class="td_numbig"><?php echo $row['od_cart_count']; ?></td>
        <td class="td_numbig text_right"><?php echo display_price($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); ?></td>
        <td class="td_numbig text_right"><?php echo display_price($row['od_receipt_price']); ?></td>
        <td class="td_numbig text_right"><?php echo display_price($row['od_misu']); ?></td>
        <td><?php echo $od_status; ?></td>
        <td>
        <a href="./itemuseform.php?it_id=<?php echo $ct['it_id'] ?>" class="btn02 itemuse_form"><?php echo $ct['it_name'] ?>후기작성</a>
        </td>
    </tr>
    <?php
    }
    if ($i == 0)
        echo '<tr><td colspan="7" class="empty_table">주문 내역이 없습니다.</td></tr>';
    ?>
    </tbody>
    </table>
</div>
<!-- } 주문 내역 목록 끝 -->

주문조회의 리스트는 주문건당으로 출력되는 리스트인데...
주문 1건당 구매상품도 1개만 주문되는 운영방식(장바구니가 없고, 바로구매만 가능한...)이 아니라면
주문조회 페이지에서는 it_id 별로 for문을 또 돌려서 상품별로 리스트를 뽑아줘야하지 않나요??

 

저도 개발자는 아니어서 그냥 머리속에 있는걸 정리해봤습니다....;;

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 123,803
© SIRSOFT
현재 페이지 제일 처음으로