레벨별 판매가격 설정이 안되네영

레벨별 판매가격 설정이 안되네영

QA

레벨별 판매가격 설정이 안되네영

본문

2레벨이면 다른가격으로 나오게 설정하고 싶은데 shop.lib랑 cartupdate 쪽을 손대도 답을 모르겠네요.

shop.lib.php


function get_price($it)
{
    global $member;
    if ($it['it_tel_inq']) return '전화문의';
    $price = $it['it_price'];
    if ($member['mb_level'] == 2 && $it['it_1'] > 0) {
        $price = $it['it_1'];
    }
    return (int)$price;
}

 

cartupdate.php


            if ($member['mb_level'] == 2 && $it['it_1'] > 0) {
              $it['it_price'] = $it['it_1'];
              }
            $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을 이상하게 손댔나 해서 이렇게 페이지에 뛰운디 봤는데


// 바로 구매일 경우
if ($sw_direct)
{
    if ($is_member)
    {
        goto_url(G5_SHOP_URL."/orderform.php?sw_direct=$sw_direct");
    }
    else
    {
        goto_url(G5_BBS_URL."/login.php?url=".urlencode(G5_SHOP_URL."/orderform.php?sw_direct=$sw_direct"));
    }
}
else
{
  $sqlll = " select ct_price
              from {$g5['g5_shop_cart_table']}
              where od_id = '$tmp_cart_id' ";
    print_r(sql_fetch($sqlll));
    print_r($it['it_price']);
    // goto_url(G5_SHOP_URL.'/cart.php');
}
 

 

 

이렇게 나오네요 분명히 insert 문에서


$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 ";
if ($member['mb_level'] == 2 && $it['it_1'] > 0) {
              $it['it_price'] = $it['it_1'];
              }
            $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' )";
 

 

이렇게 들어가게끔 설정했는데 ct_price가 왜 안바뀌는걸까요..?

이 질문에 댓글 쓰기 :

답변 1

장바구니가격 설정할때에 위처럼 바꿔주고

shop.lib.php 에서

before_check_cart_price($s_cart_id, true, true, true)함수에

$it['it_price']= get_price($it) 이거만 넣어주면 되네요 되게 간단했네요

 

답변을 작성하시기 전에 로그인 해주세요.
전체 123,643 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT