/extend/user.extend.php (추가)
<?php
// 회원 등급별 할인율
$def_member_grade_array = array(
"정회원"=>1
, "준단골"=>0.97
, "단골1"=>0.95
, "단골2"=>0.92
, "단골3"=>0.9
, "왕단골"=>0.88
, "평생가족"=>0.85
);
$def_member_grade_default = '정회원';
if($is_member && !defined("G5_IS_ADMIN"))
define("G5_SHOP_DSICOUNT_RATE", $def_member_grade_array[$member['mb_grade']]);
?>
/lib/shop.lib.php (수정)
<?php
// 금액표시
// $it : 상품 배열
function get_price($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if(defined("G5_SHOP_DSICOUNT_RATE")){
$price = round($it['it_price'] * G5_SHOP_DSICOUNT_RATE);
}else{
$price = $it['it_price'];
}
return (int)$price;
}
?>
/shop/cartupdate.php (수정)
<?php
// 옵션정보를 얻어서 배열에 저장
$opt_list = array();
$sql = " select * from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' order by io_no asc ";
$result = sql_query($sql);
$lst_count = 0;
for($k=0; $row=sql_fetch_array($result); $k++) {
if(defined("G5_SHOP_DSICOUNT_RATE"))
$row['io_price'] = round($row['io_price'] * G5_SHOP_DSICOUNT_RATE);
$opt_list[$row['io_type']][$row['io_id']]['id'] = $row['io_id'];
$opt_list[$row['io_type']][$row['io_id']]['use'] = $row['io_use'];
$opt_list[$row['io_type']][$row['io_id']]['price'] = $row['io_price'];
$opt_list[$row['io_type']][$row['io_id']]['stock'] = $row['io_stock_qty'];
// 선택옵션 개수
if(!$row['io_type'])
$lst_count++;
}
?>
g5_member 테이블에서
mb_grade 값만 넣어서 이용하시면 됩니다.
나머지는 해당 페이지에서 G5_SHOP_DSICOUNT_RATE 구문이 들어간 부분만 추가 하시면됩니다.
<?php
// 회원 등급별 할인율
$def_member_grade_array = array(
"정회원"=>1
, "준단골"=>0.97
, "단골1"=>0.95
, "단골2"=>0.92
, "단골3"=>0.9
, "왕단골"=>0.88
, "평생가족"=>0.85
);
$def_member_grade_default = '정회원';
if($is_member && !defined("G5_IS_ADMIN"))
define("G5_SHOP_DSICOUNT_RATE", $def_member_grade_array[$member['mb_grade']]);
?>
/lib/shop.lib.php (수정)
<?php
// 금액표시
// $it : 상품 배열
function get_price($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if(defined("G5_SHOP_DSICOUNT_RATE")){
$price = round($it['it_price'] * G5_SHOP_DSICOUNT_RATE);
}else{
$price = $it['it_price'];
}
return (int)$price;
}
?>
/shop/cartupdate.php (수정)
<?php
// 옵션정보를 얻어서 배열에 저장
$opt_list = array();
$sql = " select * from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' order by io_no asc ";
$result = sql_query($sql);
$lst_count = 0;
for($k=0; $row=sql_fetch_array($result); $k++) {
if(defined("G5_SHOP_DSICOUNT_RATE"))
$row['io_price'] = round($row['io_price'] * G5_SHOP_DSICOUNT_RATE);
$opt_list[$row['io_type']][$row['io_id']]['id'] = $row['io_id'];
$opt_list[$row['io_type']][$row['io_id']]['use'] = $row['io_use'];
$opt_list[$row['io_type']][$row['io_id']]['price'] = $row['io_price'];
$opt_list[$row['io_type']][$row['io_id']]['stock'] = $row['io_stock_qty'];
// 선택옵션 개수
if(!$row['io_type'])
$lst_count++;
}
?>
g5_member 테이블에서
mb_grade 값만 넣어서 이용하시면 됩니다.
나머지는 해당 페이지에서 G5_SHOP_DSICOUNT_RATE 구문이 들어간 부분만 추가 하시면됩니다.
댓글 12개
게시글 목록
| 번호 | 제목 |
|---|---|
| 852 | |
| 842 | |
| 838 | |
| 835 | |
| 829 | |
| 826 | |
| 820 | |
| 816 | |
| 811 | |
| 806 | |
| 784 | |
| 781 | |
| 778 | |
| 773 | |
| 771 | |
| 768 | |
| 766 | |
| 754 | |
| 749 | |
| 740 | |
| 737 | |
| 723 | |
| 714 | |
| 704 | |
| 698 | |
| 697 | |
| 696 | |
| 689 | |
| 688 | |
| 687 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기