레벨별 금액 적용하기
shop.lib.php
***********************
// 금액표시
// $it : 상품 배열
function get_price($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if ($member['mb_level'] >= 10 && $it['it_price_10'] > 0) {
$price = $it['it_price_10'];
} else if ($member['mb_level'] == 9 && $it['it_price_9'] > 0) {
$price = $it['it_price_9'];
} else if ($member['mb_level'] == 8 && $it['it_price_8'] > 0) {
$price = $it['it_price_8'];
} else if ($member['mb_level'] == 7 && $it['it_price_7'] > 0) {
$price = $it['it_price_7'];
} else if ($member['mb_level'] == 6 && $it['it_price_6'] > 0) {
$price = $it['it_price_6'];
} else if ($member['mb_level'] == 5 && $it['it_price_5'] > 0) {
$price = $it['it_price_5'];
} else if ($member['mb_level'] == 4 && $it['it_price_4'] > 0) {
$price = $it['it_price_4'];
} else if ($member['mb_level'] == 3 && $it['it_price_3'] > 0) {
$price = $it['it_price_3'];
} else if ($member['mb_level'] == 2 && $it['it_price_2'] > 0) {
$price = $it['it_price_2'];
} else {
$price = $it['it_price'];
}
return (int)$price;
}
it_price_2 ~~ it_price_10
까지 필드추가하시면 됩니다.
***********************
// 금액표시
// $it : 상품 배열
function get_price($it)
{
global $member;
if ($it['it_tel_inq']) return '전화문의';
if ($member['mb_level'] >= 10 && $it['it_price_10'] > 0) {
$price = $it['it_price_10'];
} else if ($member['mb_level'] == 9 && $it['it_price_9'] > 0) {
$price = $it['it_price_9'];
} else if ($member['mb_level'] == 8 && $it['it_price_8'] > 0) {
$price = $it['it_price_8'];
} else if ($member['mb_level'] == 7 && $it['it_price_7'] > 0) {
$price = $it['it_price_7'];
} else if ($member['mb_level'] == 6 && $it['it_price_6'] > 0) {
$price = $it['it_price_6'];
} else if ($member['mb_level'] == 5 && $it['it_price_5'] > 0) {
$price = $it['it_price_5'];
} else if ($member['mb_level'] == 4 && $it['it_price_4'] > 0) {
$price = $it['it_price_4'];
} else if ($member['mb_level'] == 3 && $it['it_price_3'] > 0) {
$price = $it['it_price_3'];
} else if ($member['mb_level'] == 2 && $it['it_price_2'] > 0) {
$price = $it['it_price_2'];
} else {
$price = $it['it_price'];
}
return (int)$price;
}
it_price_2 ~~ it_price_10
까지 필드추가하시면 됩니다.
댓글 4개
8년 전
간결하고 강력한 좋은 팁입니다. 감사합니다.
8년 전
장바구니쪽에 들어가려면
상품금액이 아마 기본값으로 잡힐텐데
shop/cartupdate.php 파일에서도 조금 추가해줘야하겠네요
상품금액이 아마 기본값으로 잡힐텐데
shop/cartupdate.php 파일에서도 조금 추가해줘야하겠네요
8년 전
죄송합니다ㅏ. it_price_2 ~~ it_price_10 이건 어디필드에 추가를 해야 하나요??? 그리고 할인율은 어디서 지정을?? 죄송합니다. 너무 초보라서.. ㅜㅜ
8년 전
좋은 팁 감사합니다.
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 11 | 11년 전 | 4907 | ||
| 10 | 11년 전 | 9053 | ||
| 9 | 11년 전 | 7735 | ||
| 8 | 11년 전 | 4512 | ||
| 7 | 11년 전 | 4637 | ||
| 6 | 11년 전 | 9915 | ||
| 5 |
호수의나그네
|
11년 전 | 6002 | |
| 4 | 11년 전 | 21189 | ||
| 3 | 11년 전 | 6702 | ||
| 2 | 11년 전 | 7025 | ||
| 1 | 11년 전 | 11718 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기