오늘 본 상품을 이렇게 수정하던 중에 필요하신분들도 사용하시면 좋을거 같아서 별거 아니지만 올립니다.
[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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 1483 | |
| 1481 | |
| 1479 | |
| 1474 | |
| 1473 | |
| 1463 | |
| 1458 | |
| 1457 | |
| 1456 | |
| 1452 | |
| 1449 | |
| 1448 | |
| 1442 | |
| 1441 | |
| 1426 | |
| 1411 | |
| 1389 | |
| 1388 | |
| 1372 | |
| 1359 | |
| 1357 | |
| 1355 | |
| 1348 | |
| 1347 | |
| 1338 | |
| 1332 | |
| 1328 | |
| 1313 | |
| 1307 | |
| 1303 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기