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

상품상세페이지에서 상품명옆 아이콘을 분리해서 다른위치에 출력하고 싶습니다

· 12년 전 · 36 · 3
item.gif
1.상품상세페이지에서
상품명옆에 나오는 히트 추천등 아이콘을 분리해서 다른위치에 출력하고 싶습니다.
 
2. 아이콘이 1.2.3.4.5 이렇게 가로로 출력되는데
상세페이지에서만
1.
2.
3.
4.
5
이렇게 출력하고싶은데
어떻게 해야 하나요

댓글 작성

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

로그인하기

댓글 3개

lib/shop.lib.php 의

function it_name_icon($it, $it_name="", $url=1)
{
global $g4;

$str = "";
if ($it_name)
$str = $it_name;
else
$str = stripslashes($it[it_name]);

if ($url)
$str = "<a href='$g4[shop_path]/item.php?it_id=$it[it_id]'>$str</a>";

if ($it[it_type1]) $str .= " <img src='$g4[shop_img_path]/icon_type1.gif' border='0' align='absmiddle' />";
if ($it[it_type2]) $str .= " <img src='$g4[shop_img_path]/icon_type2.gif' border='0' align='absmiddle' />";
if ($it[it_type3]) $str .= " <img src='$g4[shop_img_path]/icon_type3.gif' border='0' align='absmiddle' />";
if ($it[it_type4]) $str .= " <img src='$g4[shop_img_path]/icon_type4.gif' border='0' align='absmiddle' />";
if ($it[it_type5]) $str .= " <img src='$g4[shop_img_path]/icon_type5.gif' border='0' align='absmiddle' />";

// 품절
$stock = get_it_stock_qty($it[it_id]);
if ($stock <= 0)
$str .= " <img src='$g4[shop_img_path]/icon_pumjul.gif' border='0' align='absmiddle' /> ";

return $str;
}

위 코드에서

아이콘 출력 부분의 코드만 분리합니다.



function it_icon($it)
{
global $g4;

if ($it[it_type1]) $str .= " <img src='$g4[shop_img_path]/icon_type1.gif' border='0' align='absmiddle' />";
if ($it[it_type2]) $str .= " <img src='$g4[shop_img_path]/icon_type2.gif' border='0' align='absmiddle' />";
if ($it[it_type3]) $str .= " <img src='$g4[shop_img_path]/icon_type3.gif' border='0' align='absmiddle' />";
if ($it[it_type4]) $str .= " <img src='$g4[shop_img_path]/icon_type4.gif' border='0' align='absmiddle' />";
if ($it[it_type5]) $str .= " <img src='$g4[shop_img_path]/icon_type5.gif' border='0' align='absmiddle' />";

return $str;
}

위 코드를 적절히 수정하신후

echo $it_icon($it);

와 같은 방법으로 사용해 보시기 바랍니다.
12년 전
이해가 잘 안갑니다.
lib/shop.lib.php에 있는부분을 분리해서 item페이지에 넣어라는 것인지
lib/shop.lib.php에 본래있던 아이콘 관련 내용을 지우고
lib/shop.lib.php다른 부분에 넣어라는것인지 잘 모르겟어요

echo $it_icon($it); 은 item부분에 넣는건것 같은데..
함수명이 겹치지 않게 하기 위한것이므로 lib/shop.lib.php 나 shop/item.php 이나
어느쪽에 넣어도 상관이 없습니다.

게시글 목록

번호 제목
56073
56067
56065
56060
56058
56055
56051
56048
56044
56043
56042
56039
56035
56032
56030
56028
56025
56018
56012
56010