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

장바구니에 넣을때의 질문입니다. 채택완료

copo 8년 전 조회 2,159

gnuboard5/shop/item.php 상품 상세페이지에서 장바구니에 넣을때 g5_shop_cart" 테이블에 제조사 항목도 들어 가게하기 위해  db에 it_maker를 만들었습니다.


 테이블 : g5_shop_cart


shop/cartupdate.php의 어느 부분을 만져야 장바구니db에 제조사가 저장되나요?

몇개를 만졌지고 상품을 장바구니에 넣어 볼려 했는데 잘못만졌는지 장바구니에 상품자체가 저장되지 않아 질문 드립니다.

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

답변 3개

채택된 답변
+20 포인트
8년 전

<?php


        // 장바구니에 Insert

        $comma = '';

        $sql = " INSERT INTO {$g5['g5_shop_cart_table']}

                        ( od_id, mb_id, it_id, it_name, it_sc_type, it_sc_method, it_sc_price, it_sc_minimum, it_sc_qty, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select, ct_select_time, it_maker )

                    VALUES ";



            $sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '".addslashes($it['it_name'])."', '{$it['it_sc_type']}', '{$it['it_sc_method']}', '{$it['it_sc_price']}', '{$it['it_sc_minimum']}', '{$it['it_sc_qty']}', '쇼핑', '{$it['it_price']}', '$point', '0', '0', '$io_value', '$ct_qty', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G5_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select', '$ct_select_time','$it_maker' )";

            $comma = ' , ';

            $ct_count++;

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

답변에 대한 댓글 2개

c
copo
8년 전
답변 감사합니다.
$sql .= $comma."( '$tmp.... 이부분은 보지 못했는데 감사합니다.

이제 장바구니에는 들어가는데요 db에는 it_maker가 들어오지 않네요^^;
위에 '$it_maker' 에 대해 정의를 해주어야 하나요?
c
copo
8년 전
^^ 덕분에 해결 했습니다.
$maket = $it[it_maker]; 선언하고 불러오니 되네요^^

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

8년 전

아, 확인해보니 라인 245, 322 부분으로 나누어져있어서 그렇게 들어가지 않고..

$row가 붙을일도 없을텐데요.

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

답변에 대한 댓글 1개

c
copo
8년 전
답변 감사합니다.^^;

[code]
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
[/code]
위의 코드가 있어 아래 부분에 it_maket을 삽입 하면 장바구니 자체에 상품이 들어가질 않네요^^;
[code]
// 장바구니에 Insert
$comma = '';
$sql = " INSERT INTO {$g5['g5_shop_cart_table']}
( od_id, mb_id, it_id, it_name, it_sc_type, it_sc_method, it_sc_price, it_sc_minimum, it_sc_qty, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select, ct_select_time )
VALUES ";
[/code]

여기서는 기존 코드 이용해서 넣을 수 없는건가요?

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

8년 전

쿼리에 it_maker ='$it_maker' 이런식으로 넣으셨나요?

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

답변에 대한 댓글 1개

c
copo
8년 전
it_maker = '{$row['it_maker']}'로 넣었습니다.

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

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

로그인