레벨별 금액 적용하기
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 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 431 | 2개월 전 | 138 | ||
| 430 | 2개월 전 | 168 | ||
| 429 | 2개월 전 | 196 | ||
| 428 |
선택과집중
|
2개월 전 | 241 | |
| 427 |
선택과집중
|
3개월 전 | 390 | |
| 426 |
비버팩토리
|
3개월 전 | 361 | |
| 425 |
선택과집중
|
3개월 전 | 268 | |
| 424 |
선택과집중
|
3개월 전 | 400 | |
| 423 |
선택과집중
|
3개월 전 | 365 | |
| 422 |
선택과집중
|
3개월 전 | 334 | |
| 421 |
선택과집중
|
4개월 전 | 384 | |
| 420 | 4개월 전 | 424 | ||
| 419 |
선택과집중
|
4개월 전 | 365 | |
| 418 |
세르반데스
|
4개월 전 | 330 | |
| 417 |
선택과집중
|
4개월 전 | 420 | |
| 416 |
선택과집중
|
5개월 전 | 332 | |
| 415 |
선택과집중
|
5개월 전 | 364 | |
| 414 |
선택과집중
|
5개월 전 | 380 | |
| 413 |
선택과집중
|
5개월 전 | 464 | |
| 412 |
선택과집중
|
6개월 전 | 406 | |
| 411 |
선택과집중
|
6개월 전 | 317 | |
| 410 |
다케미카코
|
8개월 전 | 831 | |
| 409 |
다케미카코
|
8개월 전 | 584 | |
| 408 | 8개월 전 | 568 | ||
| 407 |
|
10개월 전 | 927 | |
| 406 | 11개월 전 | 1020 | ||
| 405 |
|
11개월 전 | 560 | |
| 404 | 1년 전 | 1275 | ||
| 403 | 1년 전 | 746 | ||
| 402 | 1년 전 | 780 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기