상품코드로 개별적으로 불러오기

· 12년 전 · 271 · 2
1.jpg
영카트에 등록된 상품코드로 원하는 위치에 상품을 불러오는 방법입니다.

1. lib/shop.lib : 302번째 줄에 삽입

function display_type_it($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $it_id="") 
    global $member, $g4; 

    // 상품의 갯수 
    $items = $list_mod * $list_row; 

    // 1.02.00 
    // it_order 추가 
    $sql = " select * 
              from $g4[yc4_item_table] 
              where it_use = '1' 
                and it_type{$type} = '1' "; 
    if ($it_id) $sql .= " and it_id like '$it_id%' "; 
    $sql .= " order by it_order, it_id desc 
              limit $items ";
    $result = sql_query($sql);
    if (!mysql_num_rows($result)) {
        return false;
    }

    $file = "$g4[shop_path]/$skin_file";
    if (!file_exists($file)) {
        echo "{$file} 파일을 찾을 수 없습니다.";
    } else {
        $td_width = (int)(100 / $list_mod);
        include $file;
    }
}


2. 노출시키고자하는 원하는 위치에 소스코드 삽입

<?
                $type = 1;
                if ($default["de_type{$type}_list_use"]) 
                {
                    echo "<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style=padding-top:0;>";
                    display_type_it($type, 'maintype_S01.inc.php', 1, 1, 200, 200, 1376994488);
                }
echo "</td></tr></table>";
                ?>



ex) 위 소스 분석

$type = 1; //상품타입인데 현재 1로 되어있습니다. 1은 히트상품인데 2~4번까지 있습니다.

display_type_it($type, '스킨', 1, 1, 이미지 가로, 이미지 세로, 상품코드);
            


오래전에 관리자님께서 도움을주셔서 응용해서 만들었는데 유용하게 쓰고 있습니다.
감사합니다.

위싸이트는 이번 추석준비하느라 2일동안 급하게 만든건데
조금 엉성해 보이는게 있습니다. 그냥 메인에 뿌려진 스킨만 보시면 됩니다.

첨부파일

jimin_shop.zip (7.1 KB) 8회 2013-08-21 01:49
1.jpg (542.6 KB)
0회 2013-08-21 01:48
|

댓글 2개

정말 좋은 기능이네요^^
응용해서 잘 사용하겠습니다 감사합니다 *^^*
감사감사^^

댓글 작성

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

로그인하기
🐛 버그신고