테스트 사이트 - 개발 중인 베타 버전입니다

상품 리스트 내에 인기상품 불러오기 채택완료

qwaszx 4년 전 조회 2,194

메인페이지에 인기상품 슬라이드가 있습니다(main.10.skin.php)

상품 리스트( ex. list.php?ca_id=10 ) 내에 이 슬라이드를 추가하고 싶어요

</strong></p>

<p>    <?php

    $list = new item_list();

    $list->set_category('10', 1);

    $list->set_type(3);

    $list->set_list_skin(G5_SHOP_SKIN_PATH.'/main.10.skin.php');

    $list->set_view('it_id', false);

    $list->set_view('it_name', true);

    $list->set_view('it_basic', true);

    $list->set_view('it_cust_price', true);

    $list->set_view('it_price', true);

    $list->set_view('it_icon', true);

    $list->set_view('sns', true);

    echo $list->run();

    ?>

<strong>

 

원하는 페이지모습은 목록페이지에

아래처럼 해당 목록의 인기상품을 슬라이드로 추가하는 건데

 

카테고리10 베스트

상품 상품 상품 상품

─────────

(카테고리10 목록)

상품 상품 상품 상품

상품 상품 상품 상품

상품 상품 상품 상품

상품 상품 상품 상품

 

위 코드를 list.10.skin.php에 그대로 넣으니 원래 나오는 상품목록에도 bx-wrapper가 붙으면서

레이아웃이 엉망이 됐습니다

list.skin.php내에 list를 추가로 불러오려면 어떤 함수/쿼리문을 써야하나요?

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

답변 2개

qwaszx
4년 전

</p>

<p><?php

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

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);

add_javascript('<script src="'.G5_THEME_JS_URL.'/jquery.shop.list.js"></script>', 10);

?></p>

<p><div class="">

    <ul id="sct_lst">

        <li><button type="button" class="sct_lst_view sct_lst_list"><i class="fa fa-th-list" aria-hidden="true"></i><span class="sound_only">리스트뷰</span></button></li>

        <li><button type="button" class="sct_lst_view sct_lst_gallery"><i class="fa fa-th-large" aria-hidden="true"></i><span class="sound_only">갤러리뷰</span></button></li>

    </ul></p>

<p><!-- 상품진열 10 시작 { -->

    

<div>

    <?php

    /*

    $list = new item_list();

    $list->set_category('10', 1);

    $list->set_type(3);

    $list->set_list_skin(G5_SHOP_SKIN_PATH.'/main.10.skin.php');

    $list->set_view('it_id', false);

    $list->set_view('it_name', true);

    $list->set_view('it_basic', true);

    $list->set_view('it_cust_price', true);

    $list->set_view('it_price', true);

    $list->set_view('it_icon', true);

    $list->set_view('sns', true);

    $list->set_view('it_star_score', true); // 별점 보이기

    $list->set_order_by('rand()'); //순서 랜덤

    echo $list->run();

    */

    ?>

</div></p>

<p>

<div id="curr_brand">

    <h2></h2>

    <?php

    $row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%') and it_use = '1'  ");

    ?>

    <p><span class="pointTxt"><?php echo $row2['cnt']; ?></span>개의 상품의 있습니다.</p>

</div></p>

<p><?php</p>

<p>$qq = sql_query("select it_id from {$g5['g5_shop_wish_table']} where mb_id = '{$member['mb_id']}' ");

$wishArr = array();

while($row_wish = sql_fetch_array($qq)) {

    $wishArr[] = $row_wish['it_id'];

}</p>

<p>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';

    }</p>

<p>    if ($i == 1) {

        if ($this->css) {

            echo "<ul class=\"{$this->css}\">\n";

        } else {

            echo "<ul class=\"sct sct_10 list_10\">\n";

        }

    }</p>

<p>

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

<p>    echo "<div class=\"sct_img\">\n";</p>

<p>    if ($this->href) {

        echo "<a href=\"{$this->href}{$row['it_id']}\">\n";

    }</p>

<p>    if ($this->view_it_img) {

        echo "<span class=\"sct_img_01\">".get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."</span>\n";

    }</p>

<p>    if ($this->href) {

        echo "</a>\n";

    }</p>

<p>    if ($this->view_it_icon) {

        echo item_icon2($row);

    }</p>

<p>    echo "</div>\n";</p>

<p>    echo "<div class=\"txt_wr\">\n";</p>

<p>    if ($this->view_it_id) {

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

    }</p>

<p>    if ($this->href) {

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

    }

    

    $sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '{$row['ca_id3']}' and ca_use = '1' ";

    $ca = sql_fetch($sql);

    echo "<div class=\"sct_brand\">".$ca['ca_name']."</div>\n";</p>

<p>    if ($this->view_it_name) {

        echo stripslashes($row['it_name'])."\n";

    }</p>

<p>    if ($this->href) {

        echo "</a></div>\n";

    }</p>

<p>    if ($this->view_it_cust_price || $this->view_it_price) {</p>

<p>        echo "<span class=\"sct_cost\">\n";</p>

<p>        if ($this->view_it_cust_price && $row['it_cust_price']) {

            echo "<span class=\"sct_discount\" style=\"text-decoration:line-through;\">".display_price($row['it_cust_price'])."</span>\n";

            $sale_per = "<strong class=\"sale_per\">".ceil((1 - (get_price($row)/$row["it_cust_price"]))*100)."%</strong>";

            echo str_replace("-", "", $sale_per);

        }</p>

<p>        if ($this->view_it_price) {

            echo "<span class=\"sct_price\">".display_price(get_price($row), $row['it_tel_inq'])."</span>\n";

        }</p>

<p>        echo "</span>\n";</p>

<p>    }

 

    echo "<div class=\"sct_cart_btn\"><button type=\"button\" class=\"btn_cart btn_b02 btn_s\" data-it_id=\"{$row['it_id']}\">장바구니</button> \n";

    

    echo "</div>\n";</p>

<p>    if (in_array($row['it_id'], $wishArr)) {

        echo "<div class=\"sct_btn\"><div class=\"sct_btn_wish\"><button type=\"button\" class=\"btn_wish on\" data-it_id=\"{$row['it_id']}\"><span class=\"sound_only\">위시리스트</span><img src=".G5_DOMAIN."/img/icon_heart_.png></button>\n";

        echo "<span>".get_wish_item_count($row['it_id'])."</span>";

    } else {

        echo "<div class=\"sct_btn\"><button type=\"button\" class=\"btn_wish\" data-it_id=\"{$row['it_id']}\"><span class=\"sound_only\">위시리스트</span><img src=".G5_DOMAIN."/img/icon_heart_.png></button>\n";

        echo "<span>".get_wish_item_count($row['it_id'])."</span>";

    }

    

    //별점보기

    $star_score = get_star_image($row['it_id']);

    if ($star_score) {

        echo "<div class=\"sct_btn_star\"><img src=".G5_DOMAIN."/img/s_star.png><span>".$star_score."</span></div>\n";

    } else {

        echo "<div class=\"sct_btn_star\"><img src=".G5_DOMAIN."/img/s_star.png><span>0</span></div>\n";

    }

    

    //후기 개수

    $sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$row['it_id']}' and is_confirm = '1'  ";

    $row = sql_fetch($sql);

    $item_use_count = $row['cnt'];

    echo "<div class=\"sct_btn_review\"><img src=".G5_DOMAIN."/img/s_comment.png><span>".$item_use_count."</span></div>\n";</p>

<p>

     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\"><div class=\"sct_sns_wr\"><h3>SNS 공유</h3><div>";

        echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/facebook.png');

        echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/twitter.png');

        echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/gplus.png');

        echo get_sns_share_link('kakaotalk', $sns_url, $sns_title, G5_MSHOP_SKIN_URL.'/img/sns_kakao.png');

        echo "</div><button type=\"button\" class=\"btn_close\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></button></div><div class=\"bg\"></div></div>\n";

    }

    echo "</div>\n";

    echo "<div class=\"sct_cartop\"></div>\n";

   

    echo "</li>\n";

}</p>

<p>

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

<p>if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";

?></p>

<p></div></p>

<p>

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

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

X
4년 전

작업중이신 페이지의 url 이나 소스를 추가적으로 보여주실 수 있을까요?

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

답변에 대한 댓글 1개

q
qwaszx
4년 전
소스코드를 올리느라 댓글말고 답변으로 추가했습니다ㅠㅠ
테마사용중이며 list.10.skin.php 페이지인데
해당 페이지의 상품목록 윗부분에 같은 카테고리중에 인기상품을 불러오려는거라서요ㅜㅜ

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

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

로그인