메인화면에서 이벤트 상품 출력하기
영카트5 메인화면에서 특정 이벤트 상품을 출력하는 방법니다.
아래 코드를 적절히 수정하신 후 이벤트 상품을 출력하실 위치에 추가해주시면 됩니다.
[code]
<?php
$ev_id = '1374658935'; // 이벤트 id
$ev_list_skin = G5_SHOP_SKIN_PATH.'/list.10.skin.php'; // 스킨파일 절대경로
$ev_list_mod = 3; // 가로개수
$ev_list_row = 2; // 상품줄수
$ev_img_width = 230; // 이미지폭
$ev_img_height = 230; // 이미지높이
$ev_order_by = 'b.it_order, b.it_id desc'; // 상품정렬순서
$list = new item_list($ev_list_skin, $ev_list_mod, $ev_list_row, $ev_img_width, $ev_img_height);
$list->set_event($ev_id);
$list->set_order_by($ev_order_by);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
?>
[/code]
아래 코드를 적절히 수정하신 후 이벤트 상품을 출력하실 위치에 추가해주시면 됩니다.
[code]
<?php
$ev_id = '1374658935'; // 이벤트 id
$ev_list_skin = G5_SHOP_SKIN_PATH.'/list.10.skin.php'; // 스킨파일 절대경로
$ev_list_mod = 3; // 가로개수
$ev_list_row = 2; // 상품줄수
$ev_img_width = 230; // 이미지폭
$ev_img_height = 230; // 이미지높이
$ev_order_by = 'b.it_order, b.it_id desc'; // 상품정렬순서
$list = new item_list($ev_list_skin, $ev_list_mod, $ev_list_row, $ev_img_width, $ev_img_height);
$list->set_event($ev_id);
$list->set_order_by($ev_order_by);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
?>
[/code]
댓글 5개
11년 전
감사합니다.
고민하던 부분인데 덕분에 해결 했네요.
[code]
$hsql = " select ev_id, ev_subject, ev_subject_strong from {$g5['g5_shop_event_table']} where ev_use = '1' order by ev_id desc ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
echo '<li>';
$href = G5_SHOP_URL.'/event.php?ev_id='.$row['ev_id'];
$event_img = G5_DATA_PATH.'/event/'.$row['ev_id'].'_m'; // 이벤트 이미지
if (file_exists($event_img)) { // 이벤트 이미지가 있다면 이미지 출력 - bs fix
echo '<a href="'.$href.'" class="sev_img"><img class="img-responsive" src="'.G5_DATA_URL.'/event/'.$row['ev_id'].'_m" alt="'.$row['ev_subject'].'"></a>'.PHP_EOL;
} else { // 없다면 텍스트 출력
echo '<a href="'.$href.'" class="sev_text">';
if ($row['ev_subject_strong']) echo '<strong>';
echo $row['ev_subject'];
if ($row['ev_subject_strong']) echo '</strong>';
echo '</a>'.PHP_EOL;
}
// echo '</li>'.PHP_EOL;
// echo '<li>';
$ev_id = $row['ev_id']; // 이벤트 id
$ev_list_skin = G5_SHOP_SKIN_PATH.'/main.10.skin.php'; // 스킨파일 절대경로
$ev_list_mod = 3; // 가로개수
$ev_list_row = 2; // 상품줄수
$ev_img_width = 245; // 이미지폭
$ev_img_height = 245; // 이미지높이
$ev_order_by = 'b.it_order, b.it_id desc'; // 상품정렬순서
$list = new item_list($ev_list_skin, $ev_list_mod, $ev_list_row, $ev_img_width, $ev_img_height);
$list->set_event($ev_id);
$list->set_order_by($ev_order_by);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
echo '</li>'.PHP_EOL;
}
[/code]
고민하던 부분인데 덕분에 해결 했네요.
[code]
$hsql = " select ev_id, ev_subject, ev_subject_strong from {$g5['g5_shop_event_table']} where ev_use = '1' order by ev_id desc ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
echo '<li>';
$href = G5_SHOP_URL.'/event.php?ev_id='.$row['ev_id'];
$event_img = G5_DATA_PATH.'/event/'.$row['ev_id'].'_m'; // 이벤트 이미지
if (file_exists($event_img)) { // 이벤트 이미지가 있다면 이미지 출력 - bs fix
echo '<a href="'.$href.'" class="sev_img"><img class="img-responsive" src="'.G5_DATA_URL.'/event/'.$row['ev_id'].'_m" alt="'.$row['ev_subject'].'"></a>'.PHP_EOL;
} else { // 없다면 텍스트 출력
echo '<a href="'.$href.'" class="sev_text">';
if ($row['ev_subject_strong']) echo '<strong>';
echo $row['ev_subject'];
if ($row['ev_subject_strong']) echo '</strong>';
echo '</a>'.PHP_EOL;
}
// echo '</li>'.PHP_EOL;
// echo '<li>';
$ev_id = $row['ev_id']; // 이벤트 id
$ev_list_skin = G5_SHOP_SKIN_PATH.'/main.10.skin.php'; // 스킨파일 절대경로
$ev_list_mod = 3; // 가로개수
$ev_list_row = 2; // 상품줄수
$ev_img_width = 245; // 이미지폭
$ev_img_height = 245; // 이미지높이
$ev_order_by = 'b.it_order, b.it_id desc'; // 상품정렬순서
$list = new item_list($ev_list_skin, $ev_list_mod, $ev_list_row, $ev_img_width, $ev_img_height);
$list->set_event($ev_id);
$list->set_order_by($ev_order_by);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
echo '</li>'.PHP_EOL;
}
[/code]
10년 전
필요했던 부분인데..
정말 감사합니다.
정말 감사합니다.
8년 전
감사합니다
qwaszx
4년 전
감사합니다
3년 전
와우~ 좋은정보
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 71 | 10년 전 | 7872 | ||
| 70 | 10년 전 | 5641 | ||
| 69 | 10년 전 | 5785 | ||
| 68 | 11년 전 | 11894 | ||
| 67 | 11년 전 | 8073 | ||
| 66 | 11년 전 | 6184 | ||
| 65 | 11년 전 | 6312 | ||
| 64 | 11년 전 | 6623 | ||
| 63 | 11년 전 | 7038 | ||
| 62 | 11년 전 | 10229 | ||
| 61 | 11년 전 | 23163 | ||
| 60 |
xepiesta
|
11년 전 | 4875 | |
| 59 | 11년 전 | 8271 | ||
| 58 | 11년 전 | 9004 | ||
| 57 | 11년 전 | 6683 | ||
| 56 |
|
11년 전 | 7169 | |
| 55 |
|
11년 전 | 6205 | |
| 54 | 11년 전 | 15788 | ||
| 53 |
kiplayer
|
11년 전 | 6656 | |
| 52 | 11년 전 | 7176 | ||
| 51 | 11년 전 | 10053 | ||
| 50 |
|
11년 전 | 5158 | |
| 49 | 11년 전 | 8438 | ||
| 48 | 11년 전 | 6143 | ||
| 47 | 11년 전 | 7210 | ||
| 46 | 11년 전 | 4209 | ||
| 45 | 11년 전 | 8043 | ||
| 44 | 11년 전 | 3923 | ||
| 43 | 11년 전 | 5437 | ||
| 42 | 11년 전 | 8194 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기