글 읽기
제목 검색결과에서 바로구매하기
작성자 오종선 작성일 2009-10-30 10:54:54 조회 3104
이미지
  • 이 글을 추천 하신분들(추천수 : 14)
  • 비추천 : 0
  • 1) skin/ㅌㅌㅌㅌ/mall_search.html 을 열고
    2) 맨 위 상단에 스크립트를 넣어줍니다.
    <script language=JavaScript>
    <!--
    function sendcart(form_name, c_flag){
    form_name.ps_select.value = c_flag;
    form_name.action = "m_cart.php";
    form_name.submit();
    return;
    }
    -->
    </script>

    3) while 전에 <?$g_co = 0;?> 를 넣어줍니다.

    <?$g_co = 0;?>
    <?
    while($list = morning_fetch_array($result)) {

    4) while 시작하고나서 <?$g_co++;?> 를 넣어줘서 카운트를 세줍니다.

    5) while 안에 form 을 넣어줍니다.
    <form name="goods_<?=$g_co?>" method="post" action="m_cart.php">
    <input type="hidden" name="ps_ctid" value="<?=$list[goods_category]?>">
    <input type="hidden" name="ps_goid" value="<?=$list[uid]?>">
    <input type="hidden" name="ps_select" value="C">
    <input type="hidden" name="ps_num" value="1">

    6) 바로구매버튼을 만들어줍니다.
    <a href="javascript:sendcart(goods_<?=$co?>,'D')"><img src="<?=$g_skin_link?>/image/cart_007.gif" border="0" align="absmiddle"></a>

    7) while 이 닫히기전에 </form> 을 넣어줘서 폼을 닫아줍니다.

    끝!

    제가 쓴 소스의 전문입니다.

    <?
    /*
    #################################################################################
    모닝몰 상품 검색 리스트 페이지 스킨
    #################################################################################
    */
    ?>

    <!-- 모닝몰 상품검색 -->
    <?
    echo "<table border=0 cellspacing=0 cellpadding=0 width=987><tr valign=top><td width=232>";
    include "$g_skin_link/mall_leftmenu2.html";
    echo "</td><td width=10></td><td width=745>";
    ?>

    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
    <td width="5"><img src="<?=$g_skin_link?>/image/cart_list01.gif" alt=""></td>
    <td style="background-color:#84C126;color:#68991E;font-size:11px;padding-top:3px;"><div id=cartx>   <b><?=make_navigation("$NAVIGATION_SEARCH_RESULT_TEXT","m_search.php")?></b></div></td>
    <td style="background-color:#84C126;color:#D1F8C7;font-size:11px;padding-top:3px;font-family:dotum;" align="right">검색어 '<span style="color:white;font-size:12px;font-weight:bold;"><?=$ps_search;?></span>'로 총 <span style="color:white;font-size:12px;font-weight:bold;"><?=$total_count?></span> 개의 상품이 검색되었습니다  </td>
    <td width="5"><img src="<?=$g_skin_link?>/image/cart_list02.gif" alt=""></td>
    </tr>
    </table>
    <script language=JavaScript>
    <!--
    function sendcart(form_name, c_flag){
    form_name.ps_select.value = c_flag;
    form_name.action = "m_cart.php";
    form_name.submit();
    return;
    }

    -->
    </script>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
    <tr>
    <td width="80"><a href="m_mall_detail.php?ps_ctid=<?=$list[goods_category]?>&ps_goid=<?=$list[uid]?>"><?=$show_file1?></a></td>
    </tr>
    <tr>
    <td width="100%" valign="top">
    <table border="0" cellpadding="5" cellspacing="0" width="95%" align="center" bgcolor="white">
    <?if($total_count == "0") {?>
    <tr>
    <td align="center"><img src="<?=$g_skin_link?>/image/image_nogoods.gif"></td>
    </tr>
    <?}?>

    <?$g_co = 0;?>
    <?
    while($list = morning_fetch_array($result)) {
    $list[register_date] = date("Y-m-d",$list[register_date]);

    if($list[goods_file1]) { $show_file1 = "<div style='background-image:url($list[goods_file1]);width:80px;height:80px;cursor:pointer;'><a href=m_mall_detail.php?ps_ctid=$list[goods_category]&ps_goid=$list[uid]><img src='$g_skin_link/image/product_thumb_bg.gif' width='80' height='80'></div></a>"; }
    else { $show_file1 = "<img src=\"$g_skin_link/image/noimage1.gif\" width=\"100\" height=\"100\" border=\"0\">"; }

    if($list[goods_point] and $cf_account_method > "3") { $show_point = "적립금:".number_format($list[goods_point])."점"; }
    else { $show_point = ""; }

    if($list[goods_addoption1]) { $show_addoption1 = "<img src=\"$g_skin_link/image/add_option001-1.gif\" border=\"0\">"; }
    else { $show_addoption1 = ""; }

    if($list[goods_addoption2]) { $show_addoption2 = "<img src=\"$g_skin_link/image/add_option002-1.gif\" border=\"0\">"; }
    else { $show_addoption2 = ""; }

    if($list[goods_addoption3]) { $show_addoption3 = "<img src=\"$g_skin_link/image/add_option003-1.gif\" border=\"0\">"; }
    else { $show_addoption3 = ""; }

    if($list[goods_addoption4]) { $show_addoption4 = "<img src=\"$g_skin_link/image/add_option004-1.gif\" border=\"0\">"; }
    else { $show_addoption4 = ""; }

    if($list[goods_sale_price] == "0") $show_sale_price = "[가격문의]"; else $show_sale_price = number_format($list[goods_sale_price])."원";
    ?>


    <?
    if($ps_search) { $list[goods_name] = eregi_replace("$ps_search", "<span class='search_list'>$ps_search</span>", $list[goods_name]);}
    ?>
    <?$g_co++;?>
    <form name="goods_<?=$g_co?>" method="post" action="m_cart.php">
    <input type="hidden" name="ps_ctid" value="<?=$list[goods_category]?>">
    <input type="hidden" name="ps_goid" value="<?=$list[uid]?>">
    <input type="hidden" name="ps_select" value="C">
    <input type="hidden" name="ps_num" value="1">
    <tr>
    <td width="100%"bgcolor="white">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td width="110"><a href="m_mall_detail.php?ps_goid=<?=$list[uid]?>&ps_goid=<?=$list[uid]?>"><?=$show_file1?></a></td>
    <td valign="middle" align="left">
    <b><a href="m_mall_detail.php?ps_ctid=<?=$list[goods_category]?>&ps_goid=<?=$list[uid]?>"><?=$list[goods_name]?></a></b> (<?=$show_point?>)<br>
    <?=$show_stock?>
    <?=$show_addoption1?>
    <?=$show_addoption2?>
    <?=$show_addoption3?>
    <?=$show_addoption4?>
    </td>
    <td width="140" align="left"><script language="javascript">FlashObject("<?=$g_skin_link?>/js/price2.swf", 140, 40, "price=<?=$show_sale_price?>");</script></td>
    <td width="20"></td>
    <td width="100"><a href="javascript:sendcart(goods_<?=$co?>,'D')"><img src="<?=$g_skin_link?>/image/cart_007.gif" border="0" align="absmiddle"></a></td>
    </tr>

    </table>
    </td>
    </tr>
    <tr>
    <td width="100%" height="1" background="<?=$g_skin_link?>/image/dot.gif"></td>
    </tr>
    </form>

    <?
    }
    ?>
    <tr>
    <td width="100%" colspan="4" align="center">
    <?
    $page_list = page_list($ps_page, $total_page, $list_num, $page_num, "m_search.php?ps_ctid=$ps_ctid&ps_search=$ps_search&ps_company=$ps_company&ps_brand=$ps_brand&ps_min_money=$ps_min_money&ps_max_money=$ps_max_money&ps_line=$ps_line&ps_page=");
    if ($page_list != "") {
    echo " ".$page_list." ";
    }
    ?>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <!-- 모닝몰 상품 검색 -->
    <?
    echo "</td></tr></table>";
    echo "</div>";
    ?>

    댓글 등록 폼
    자동입력방지 :
    댓글 (총0 개)