레벨4이상 이상 볼수 있는 특별회원가2 를 추가하는 방법을 알고 싶습니다.
링크의 슈어몰님의 질문을 보고 해 봤습니다. 필요하신 분들은 참고해 주세요.
알고 계신분은 패스 ~~~ 해 주세요. ^_^
=================================================================================
아이템 테이블에 it_amount4 라는 이름으로 가격 필드를 INT 형식으로 추가합니다.
ALTER TABLE `yc4_item` ADD `it_amount4` INT NOT NULL AFTER `it_amount3` ;
shop.lib.php 의
// 금액표시
// $it : 상품 배열
function get_amount($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if ($member[mb_level] > 2) // 특별회원
$amount = $it[it_amount3];
if ($member[mb_level] == 2 || $amount == 0) // 회원가격
$amount = $it[it_amount2];
if ($member[mb_level] == 1 || $amount == 0) // 비회원가격
$amount = $it[it_amount];
return (int)$amount;
}
를
// 금액표시
// $it : 상품 배열
function get_amount($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
// $it : 상품 배열
function get_amount($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if ($member[mb_level] >= 4) // 특별회원2
$amount = $it[it_amount4];
if ($member[mb_level] == 3 || $amount == 0) // 특별회원
$amount = $it[it_amount3];
if ($member[mb_level] == 2 || $amount == 0) // 회원가격
$amount = $it[it_amount2];
if ($member[mb_level] == 1 || $amount == 0) // 비회원가격
$amount = $it[it_amount];
return (int)$amount;
}
$amount = $it[it_amount4];
if ($member[mb_level] == 3 || $amount == 0) // 특별회원
$amount = $it[it_amount3];
if ($member[mb_level] == 2 || $amount == 0) // 회원가격
$amount = $it[it_amount2];
if ($member[mb_level] == 1 || $amount == 0) // 비회원가격
$amount = $it[it_amount];
return (int)$amount;
}
로 수정 합니다.
adm/shop_admin/itemformupdate.php 의
it_amount = '$it_amount',
it_amount2 = '$it_amount2',
it_amount3 = '$it_amount3',
에
it_amount = '$it_amount',
it_amount2 = '$it_amount2',
it_amount3 = '$it_amount3',
it_amount4 = '$it_amount4',
it_amount2 = '$it_amount2',
it_amount3 = '$it_amount3',
it_amount4 = '$it_amount4',
it_amount4 를 추가 합니다.
adm/shop_admin/itemform.php 에
<td width=13%>특별가2 <?=help("상품의 로그인 이후 가격(회원 권한 4 이상에 적용)이며 옵션별로 상품가격이 틀리다면 합산하여 상품상세페이지에 출력합니다.\n\n입력이 없다면 회원가격으로 대신합니다.\n회원가격도 없다면 비회원가격으로 대신합니다.", 50);?></td>
와
<td><input type=text class=ed name=it_amount4 size=8 value='<?=$it[it_amount4]?>' style='text-align:right; background-color:#FEDDDD;'></td>
를
기존 항목 옆에 위 두 항목을 추가 합니다.
첨부파일
댓글 7개
게시글 목록
| 번호 | 제목 |
|---|---|
| 1053 | |
| 1044 | |
| 1041 | |
| 1022 | |
| 978 | |
| 975 | |
| 974 | |
| 967 | |
| 964 | |
| 963 | |
| 962 | |
| 958 | |
| 957 | |
| 952 | |
| 934 | |
| 929 | |
| 923 | |
| 921 | |
| 905 | |
| 903 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기