메인화면에서 이벤트 상품 출력하기
영카트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 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 371 |
이로홀딩스
|
2년 전 | 1554 | |
| 370 |
페이투페이
|
2년 전 | 1557 | |
| 369 | 2년 전 | 1305 | ||
| 368 | 2년 전 | 1719 | ||
| 367 | 2년 전 | 2062 | ||
| 366 | 2년 전 | 2275 | ||
| 365 | 2년 전 | 2079 | ||
| 364 | 2년 전 | 1607 | ||
| 363 | 3년 전 | 1350 | ||
| 362 | 3년 전 | 3120 | ||
| 361 | 3년 전 | 1924 | ||
| 360 |
|
3년 전 | 2674 | |
| 359 | 3년 전 | 2431 | ||
| 358 | 3년 전 | 1591 | ||
| 357 |
welcome
|
3년 전 | 1320 | |
| 356 | 3년 전 | 1634 | ||
| 355 | 3년 전 | 1896 | ||
| 354 | 3년 전 | 1564 | ||
| 353 | 3년 전 | 1272 | ||
| 352 | 3년 전 | 1322 | ||
| 351 | 3년 전 | 1431 | ||
| 350 | 3년 전 | 2519 | ||
| 349 | 3년 전 | 1677 | ||
| 348 | 3년 전 | 3277 | ||
| 347 | 3년 전 | 4072 | ||
| 346 | 4년 전 | 2825 | ||
| 345 | 4년 전 | 4494 | ||
| 344 |
별지기천사
|
4년 전 | 3990 | |
| 343 | 4년 전 | 3413 | ||
| 342 | 4년 전 | 2029 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기