2026, 새로운 도약을 시작합니다.

장바구니에 설정가격이 표시되지않습니다. 채택완료

최신버전으로 수정작업하는데 쉽질안네요...ㅠ.ㅠ

상세페이지까지는 표시가 됩니다만 장바구니로 넘어가면 원래 가격이 표시됩니다.ㅠ.ㅠ

www/lib/shop.lib.php에서

Copy


// $it : 상품 배열

function get_price($it)

{

    global $member;

 

    if ($it['it_tel_inq']) return '전화문의';

 

    if($member['mb_level'] == 1) {

    $price = $it['it_price'];

    }

    else if ($member['mb_level'] == 2) {

    $price = $it['it_price2'];

    }

    else if ($member['mb_level'] == 3) {

    $price = $it['it_price3'];

    }

    else if ($member['mb_level'] == 4) {

    $price = $it['it_price4'];

    }

    else if ($member['mb_level'] == 5) {

    $price = $it['it_price5'];

    }

   

    else if ($member['mb_level'] == 10) {

    $price = $it['it_price'];

    }

    return (int)$price;

}



 


를 수정해줬고
theme/basic/cartupdate.php에서 
Copy


 // 배송비결제

            if($it['it_sc_type'] == 1)

                $ct_send_cost = 2; // 무료

            else if($it['it_sc_type'] > 1 && $it['it_sc_method'] == 1)

                $ct_send_cost = 1; // 착불

           

               

 

            $io_value = sql_real_escape_string(strip_tags($io_value));

            $remote_addr = get_real_client_ip();

           

            // 회원 레벨별/등급별 가격 정하기

                   

                if ($member['mb_level'] >= 10 | $is_admin == 'super') {

                $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_price2']}', '$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' )";                  

                }

               

       

                else if ($member['mb_level'] == 3) {

                    $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_price3']}', '$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' )";

                }

               

                else if ($member['mb_level'] == 2) {

                    $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_price2']}', '$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' )";

                }

               

                else {

                    $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' )";

                }

                // 회원 레벨별/등급별 가격 정하기

 

           // $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' )";

            $comma = ' , ';

            $ct_count++;

        }

 

        if($ct_count > 0)

            sql_query($sql);

    }

}

이리 수정해주었는데......장바구니에서는 원래 판매가격이 다시 출력됩니다.
제가 수정을 잘못했나요?

아시는분들 조언 부탁 드리겠습니다.

답변 2개

채택된 답변
+20 포인트

해당 함수를 안봐서 모르겠지만 $it이 있다면 해당 처럼 쓰시면 될거고 $member는 없을거라서 글로벌 변수를 선언해주셔야 할겁니다.

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

답변에 대한 댓글 1개

감사합니다. 덕분에 해결하였습니다.
좋은 저녁되세요~

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

최신버전이면 장바구니 가면 before_check_cart_price 함수에 의해서 다시 가격이 정해질겁니다.

lib/shop.lib.php 에서 해당 함수도 수정을 해주셔야 합니다.

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

답변에 대한 댓글 1개

아래처럼 추가해주었는데 결과는 똑같습니다.ㅠ.ㅠ
잘못 추가해 준걸까요?

// 회원 등급에 따른 상품 가격 할당
if ($member['mb_level'] == 2 && $it['it_price2'] > 0) { // 2등급 회원 가격
$it_price = $it['it_price2'];
} elseif ($member['mb_level'] == 3 && $it['it_price3'] > 0) { // 3등급 회원 가격
$it_price = $it['it_price3'];
} else { // 기본 가격
$it_price = $it['it_price'];
}

if ($it_price !== $row['ct_price']) {
// 장바구니 테이블 상품 가격과 상품 테이블의 상품 가격이 다를경우
$update_querys['ct_price'] = $it_price;
}

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

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

로그인
🐛 버그신고