회원 가격과 비회원 가격을 다르게 하려고 합니다. 채택완료
회원 가격과 비회원 가격을 다르게 하려고 합니다.
그래서 다른 글을 찾아보고 수정하고있는데,.
계속 같은 오류가 떠서 질문드립니다.
adm/shop_admin_itemform.php 파일에
<th scope="row"><label for="it_1">회원가격</label></th>
<td colspan="2">
<input type="text" name="it_1" value="<?php echo $it['it_1']; ?>" id="it_1" class="frm_input" size="8"> 원
</td>
을 추가하고
여분필드쪽 <?php for ($i=2; $i<=10; $i++) { ?> 이렇게 수정하고
lib/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;
}
수정한후
shop/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' )";
$comma = ' , ';
$ct_count++;
추가를 했는데
계속

이게 떠서 막막합니다.
비회원은 또 잘되더군요ㅠㅠ
테마 때문에 그런가 싶어서
theme/shop/ajax.cartupdate.php 도 같이 수정을 했는데도 같은 현상이 반복됩니다.
어떻게 해결해야 할까요ㅠㅠ
답변 2개
lib/shop.lib.php에 있는 get_price()를 변경하셨다면
shop/cartupdate.php 에서
// 상품정보
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$it = sql_fetch($sql);
이 다음에
$tmp_p= get_price( $it);
if( (int)$tmp_p > 0) $it['it_price']= $tmp_p;
를 추가해 보세요.
답변에 대한 댓글 4개
// 상품정보
$it = get_shop_item($it_id, false);
if(!$it['it_id'])
alert('상품정보가 존재하지 않습니다.');
$it = get_shop_item($it_id, false);
if(!$it['it_id'])
alert('상품정보가 존재하지 않습니다.');
$tmp_p= get_price( $it);
if( (int)$tmp_p > 0) $it['it_price']= $tmp_p;
이렇게추가해도 같은현상이 나타나네요ㅠㅠ
최근 버전에서는 안 되나 보군요.
cartupdate.php에서 가격 관한 코드를 다 살펴 봐야합니다.
/lib/shop.lib.php"
// 장바구니 금액 체크 $is_price_update 가 true 이면 장바구니 가격 업데이트한다.
function before_check_cart_price()에서
$it_id = $row['it_id'];
$it = get_shop_item($it_id, $is_item_cache);
이 다음에도 it_price를 변경하는 부분을 추가해 보세요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인