wish리스트 장바구니 처럼 사용하는 방법이.. 채택완료

wish리스트 장바구니 처럼 사용하는 방법이.. 장바구니는 세션에 저장해서 사용하는거 같은데 wish리시트의 경우 세션을 저장안하는데 굳이 세션에 저장해서 사용해야하나요?아니면 그냥 sql에 있는 값을 들고오면되나요??ㅜ

혹시 메인에 wish리스트 현재갯수를 표시할수있는 방법이? 

답변 1개

채택된 답변
+20 포인트

퇴근전이라 질문은 월요일에..

테스트 사이트 : http://www.uhub.co.kr/shop/

 

/skin/shop/basic/main.10.skin.php 파일입니다. 타 빌더를 이용하셨으면 변영이 되어 있을 수 있습니다.

붉은색 부분 참조해서 해보세요.

 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?>

<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
    if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
        if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
        else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
        else $sct_last = '';
    } else { // 1줄 이미지 : 1개
        $sct_last = 'sct_clear';
    }

    $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 a.it_id = '{$row['it_id']}') ";
    $crow = sql_fetch($sql);
    $item_wish_count = $crow['cnt'];

   
    if ($i == 1) {
        if ($this->css) {
            echo "<ul class=\"{$this->css}\">\n";
        } else {
            echo "<ul class=\"sct sct_10\">\n";
        }
    }

    echo "<li class=\"sct_li {$sct_last}\" style=\"width:{$this->img_width}px\">\n";

    if ($this->href) {
        echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
    }

    if ($this->view_it_img) {
        echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
    }

    if ($this->href) {
        echo "</a></div>\n";
    }

    if ($this->view_it_icon) {
        echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
    }

    if ($this->view_it_id) {
        echo "<div class=\"sct_id\">&lt;".stripslashes($row['it_id'])."&gt;</div>\n";
    }

    if ($this->href) {
        echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\" class=\"sct_a\">\n";
    }

    if ($this->view_it_name) {
        echo stripslashes($row['it_name'])."\n";
    }

    if ($this->href) {
        echo "</a></div>\n";
    }

    if ($this->view_it_basic && $row['it_basic']) {
        echo "<div class=\"sct_basic\">".stripslashes($row['it_basic'])."</div>\n";
    }

    if ($this->view_it_cust_price || $this->view_it_price) {

        echo "<div class=\"sct_cost\">\n";

        if ($this->view_it_cust_price && $row['it_cust_price']) {
            echo "<strike>".display_price($row['it_cust_price'])."</strike>\n";
        }

        if ($this->view_it_price) {
            echo display_price(get_price($row), $row['it_tel_inq'])."\n";
        }

        echo "</div>\n";

    }
   
    echo "<div class=\"sct_txt\">wish : ".stripslashes($item_wish_count)."</div>\n";

    if ($this->view_sns) {
        $sns_top = $this->img_height + 10;
        $sns_url  = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
        $sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
        echo "<div class=\"sct_sns\" style=\"top:{$sns_top}px\">";
        echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/sns_fb_s.png');
        echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/sns_twt_s.png');
        echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/sns_goo_s.png');
        echo "</div>\n";
    }

    echo "</li>\n";
}

if ($i > 1) echo "</ul>\n";

if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 10 끝 -->

로그인 후 평가할 수 있습니다

답변에 대한 댓글 8개

지금 페이지의 경우 아이템 내에 페이지가 있는데 저는 메인에서 노출시키는거라 아이템을 못들고오는데 장바구니 경우 세션에서 카운트해서 오는데..wishlist의 경우..어떻게 해야될지.ㅠㅠ
파일명 보시면 메인 스킨입니다.
근데 shop.head.php부분이랑 boxtoday.skin.php부분에 넣을거라....;;; it_id값을 못불러내지않나요?ㅠ
boxtoday.skin.php는 $rowx['it_id'] 값이 있으니 위 붉은색 쿼리에 $rowx['it_id'] 으로 조회를 하면 되나 shop.head.php는 기준이 없으니 힘들겠네요..
$rowx['it_id']로 검색시 상품 번호로 조회를 해서 한개만뜨게 되는데..전 찜한상품리스트에 있는걸 총 갯수를 보고싶은데...ㅠㅠㅠ shop.head.php부분은 필요없을듯해요.ㅠ boxtoday.skin.php부분만 넣으면 될듯해요
$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']}') ";
$crow = sql_fetch($sql);
$item_wish_count = $crow['cnt'];

echo $item_wish_count;

원하시는 회원별 위시테이블 내에 총 갯수 입니다.
대박 감사드립니다....ㅠㅠㅠ
잘 되시면 다행입니다. ^^;;

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고