레벨별 금액 적용하기
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 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 251 | 7년 전 | 4743 | ||
| 250 | 7년 전 | 3977 | ||
| 249 | 7년 전 | 3455 | ||
| 248 | 7년 전 | 4953 | ||
| 247 | 7년 전 | 3105 | ||
| 246 | 7년 전 | 6126 | ||
| 245 |
|
7년 전 | 3137 | |
| 244 | 7년 전 | 6854 | ||
| 243 | 7년 전 | 3329 | ||
| 242 |
|
7년 전 | 4052 | |
| 241 |
세르반데스
|
7년 전 | 5798 | |
| 240 | 7년 전 | 8038 | ||
| 239 | 7년 전 | 3872 | ||
| 238 | 7년 전 | 3819 | ||
| 237 |
|
7년 전 | 3946 | |
| 236 | 7년 전 | 5535 | ||
| 235 |
아생연후살타
|
7년 전 | 4509 | |
| 234 | 7년 전 | 5168 | ||
| 233 | 7년 전 | 3749 | ||
| 232 | 7년 전 | 3735 | ||
| 231 | 7년 전 | 3567 | ||
| 230 |
인아이디어
|
7년 전 | 7280 | |
| 229 | 7년 전 | 4383 | ||
| 228 | 7년 전 | 5126 | ||
| 227 | 7년 전 | 3396 | ||
| 226 | 7년 전 | 4263 | ||
| 225 | 7년 전 | 4983 | ||
| 224 | 7년 전 | 3518 | ||
| 223 | 7년 전 | 5088 | ||
| 222 | 7년 전 | 10613 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기