웹

장바구니/관심상품/주문배송 카운트 표시

· 2017-06-09 (금) 09:26:16 · 5721 · 4
box.jpg
오늘 본 상품을 이렇게 수정하던 중에 필요하신분들도 사용하시면 좋을거 같아서 별거 아니지만 올립니다.

[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]

첨부파일

box.jpg (21.6 KB)
0회 2017-06-09 09:26
|

댓글 4개

2017-06-12 (월) 09:20:30
좋은정보 감사합니다.
좋은정보 감사합니다.
2018-09-14 (금) 20:11:24
감사합니다.
2019-12-13 (금) 12:38:14
애용하고있습니다
댓글을 작성하시려면 로그인이 필요합니다.

영카트5 팁자료실

455건
+
제목 글쓴이 날짜 조회
17-11-07 조회 3,534
17-10-25 조회 6,240
17-10-19 조회 4,619
17-10-18 조회 5,883
17-10-07 조회 5,117
17-09-21 조회 1.2만
17-09-13 조회 5,984
17-09-03 조회 4,646
17-08-10 조회 5,583
17-08-03 조회 5,487
17-08-01 조회 5,058
17-08-01 조회 4,178
17-07-27 조회 5,460
17-07-06 조회 5,797
17-06-24 조회 6,315
17-06-22 조회 5,933
17-06-17 조회 7,934
17-06-15 조회 5,033
17-06-13 조회 5,913
17-06-09 조회 5,722
17-06-08 조회 4,577
17-06-08 조회 6,468
17-06-04 조회 5,900
17-06-02 조회 8,542
17-05-31 조회 5,121
17-05-24 조회 5,717
17-05-22 조회 6,192
17-05-19 조회 4,538
17-05-11 조회 9,587
17-05-10 조회 9,973