장바구니/관심상품/주문배송 카운트 표시
오늘 본 상품을 이렇게 수정하던 중에 필요하신분들도 사용하시면 좋을거 같아서 별거 아니지만 올립니다.
[code]
// 장바구니 카운트
function get_cart_count2($cart_id)
{
global $g5, $default;
$sql = " select count(distinct it_id) as cnt from {$g5['g5_shop_cart_table']} where od_id = '$cart_id' ";
$row = sql_fetch($sql);
$cnt = (int)$row['cnt'];
return $cnt;
}
// 관심상품(위시리스트) 카운트
$sql = " select count(a.it_id) as cnt from {$g5['g5_shop_item_table']} a join {$g5['g5_shop_wish_table']} b on ( a.it_id = b.it_id and b.mb_id = '{$member['mb_id']}') ";
$row = sql_fetch($sql);
$item_wish_count = $row['cnt'];
// 주문배송 카운트
$sql = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
$item_order_count = $row['cnt'];
?>
장비구니 : <?=get_cart_count2(get_session('ss_cart_id'));?>
관심상품 : <?php echo $item_wish_count; ?>
주문배송 : <?php echo $item_order_count ;?>
[/code]
[code]
// 장바구니 카운트
function get_cart_count2($cart_id)
{
global $g5, $default;
$sql = " select count(distinct it_id) as cnt from {$g5['g5_shop_cart_table']} where od_id = '$cart_id' ";
$row = sql_fetch($sql);
$cnt = (int)$row['cnt'];
return $cnt;
}
// 관심상품(위시리스트) 카운트
$sql = " select count(a.it_id) as cnt from {$g5['g5_shop_item_table']} a join {$g5['g5_shop_wish_table']} b on ( a.it_id = b.it_id and b.mb_id = '{$member['mb_id']}') ";
$row = sql_fetch($sql);
$item_wish_count = $row['cnt'];
// 주문배송 카운트
$sql = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
$item_order_count = $row['cnt'];
?>
장비구니 : <?=get_cart_count2(get_session('ss_cart_id'));?>
관심상품 : <?php echo $item_wish_count; ?>
주문배송 : <?php echo $item_order_count ;?>
[/code]
댓글 4개
브러운아이
8년 전
좋은정보 감사합니다.
7년 전
좋은정보 감사합니다.
7년 전
감사합니다.
디자인웨이브
5년 전
애용하고있습니다
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 341 | 4년 전 | 4068 | ||
| 340 | 4년 전 | 3375 | ||
| 339 | 4년 전 | 3206 | ||
| 338 | 4년 전 | 3770 | ||
| 337 | 4년 전 | 4125 | ||
| 336 | 4년 전 | 2804 | ||
| 335 |
|
4년 전 | 2695 | |
| 334 | 4년 전 | 2251 | ||
| 333 |
|
4년 전 | 2311 | |
| 332 |
|
4년 전 | 3151 | |
| 331 |
|
4년 전 | 3796 | |
| 330 | 4년 전 | 2207 | ||
| 329 | 4년 전 | 3698 | ||
| 328 | 4년 전 | 2165 | ||
| 327 | 4년 전 | 2727 | ||
| 326 | 4년 전 | 2587 | ||
| 325 | 4년 전 | 5029 | ||
| 324 | 4년 전 | 2197 | ||
| 323 |
파이브스톤즈
|
5년 전 | 3022 | |
| 322 | 5년 전 | 2521 | ||
| 321 | 5년 전 | 2552 | ||
| 320 | 5년 전 | 1884 | ||
| 319 | 5년 전 | 2564 | ||
| 318 | 5년 전 | 4108 | ||
| 317 | 5년 전 | 4107 | ||
| 316 | 5년 전 | 2651 | ||
| 315 | 5년 전 | 3830 | ||
| 314 | 5년 전 | 3644 | ||
| 313 |
|
5년 전 | 1645 | |
| 312 | 5년 전 | 4153 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기