웹프로그래밍

Global It Leader!!


그누보드


 
 

영카트 배송비 따로 설정 가능하게

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 3,963회 작성일 13-01-31 17:34

본문





* 링크된 사이트는 실제로 운영하시는 분의 사이트 입니다.
* 영카트 의뢰 작업을 하던 중 기능 업데이트를 하게 되어 부족한 실력으로 공유 합니다.
* 아래 설명데로 작업 하시면 상품마다 택배비 부분을 따로 설정하여 운영하실 수 있습니다.

'it_cost_case' VARCHAR(20) NULL DEFAULT NULL,
'it_cost_limit` VARCHAR(20) NULL DEFAULT NULL,

위 두개의 필드를 yc4_cart 테이블과 yc4_item 에 추가 합니다.

============================================================================================
아래의 배송비 추가 사항을 /shop_admin/itemform.php 에 추가 합니다.
(저는 가격 / 포인트 / 재고 밑에 추가 했습니다. )

<tr class=ht>
    <td>배송선택</td>
    <td><input type=checkbox name=it_cost_case value="무료" <? if($it[it_cost_case]=="무료") echo "checked"; ?> onclick="doOpenCheck(this)"> 무료배송&nbsp;<input type=checkbox name=it_cost_case value="유료" <? if($it[it_cost_case]=="유료") echo "checked"; ?> onclick="doOpenCheck(this)"> 유료배송&nbsp;</td>
    <td>배송비 결정</td>
    <td>
* 선불, 착불시 택배비  :  <input type=text class=ed name=it_cost_limit size=13 value='<?=$it[it_cost_limit]?>' style='text-align:right; background-color:#DDFEDE;'> 원
</td>
</tr>

============================================================================================
/shop_admin/itemformupdate.php 파일에 아래 내용을 추가 합니다. (저는 241번째 줄)

$sql_common = " ca_id            = '$ca_id',
                ca_id2          = '$ca_id2',
                ca_id3          = '$ca_id3',
                it_name          = '$it_name',
                it_gallery      = '$it_gallery',
                it_maker        = '$it_maker',
                it_origin        = '$it_origin',
                it_opt1_subject  = '$it_opt1_subject',
                it_opt2_subject  = '$it_opt2_subject',
                it_opt3_subject  = '$it_opt3_subject',
                it_opt4_subject  = '$it_opt4_subject',
                it_opt5_subject  = '$it_opt5_subject',
                it_opt6_subject  = '$it_opt6_subject',
                it_opt1          = '$it_opt1',
                it_opt2          = '$it_opt2',
                it_opt3          = '$it_opt3',
                it_opt4          = '$it_opt4',
                it_opt5          = '$it_opt5',
                it_opt6          = '$it_opt6',
                it_type1        = '$it_type1',
                it_type2        = '$it_type2',
                it_type3        = '$it_type3',
                it_type4        = '$it_type4',
                it_type5        = '$it_type5',
                it_type6        = '$it_type6',
                it_type7        = '$it_type7',
                it_type8        = '$it_type8',
                it_type9        = '$it_type9',
                it_type10        = '$it_type10',
                it_type11        = '$it_type11',
                it_type12        = '$it_type12',
                it_cost_case        = '$it_cost_case',
                it_cost_limit        = '$it_cost_limit',
                it_basic        = '$it_basic',
                it_explan        = '$it_explan',
                it_explan_html  = '$it_explan_html',
                it_cust_amount  = '$it_cust_amount',
                it_amount        = '$it_amount',
                it_amount2      = '$it_amount2',
                it_amount3      = '$it_amount3',
                it_point        = '$it_point',
                it_sell_email    = '$it_sell_email',
                it_use          = '$it_use',
                it_stock_qty    = '$it_stock_qty',
                it_head_html    = '$it_head_html',
                it_tail_html    = '$it_tail_html',
                it_time          = '$g4[time_ymdhis]',
                it_ip            = '$_SERVER[REMOTE_ADDR]',
                it_order        = '$it_order',
                it_tel_inq      = '$it_tel_inq'
                ";

==============================================================================================
/shop/item.php 파일에 수량 밑이나 적절한 곳에 아래 내용을 추가 합니다.

<? if($it[it_cost_case]=="유료") { ?>
<tr height=25>
<td>&nbsp;&nbsp;&nbsp; · 배 송</td>
<td align=center>:</td>
<td>
<select name=it_cost_case>
<option value="착불">착불</option>
<option value="선불">선불</option>
</select>
<input type=hidden name=it_cost_limit value="<?=$it["it_cost_limit"];?>">
&nbsp;<?=$it["it_cost_limit"];?>원  (선택하지 않는 경우 착불로 적용)</td>
</tr>
<tr><td colspan=3 height=1 background='<?=$g4[shop_img_path]?>/dot_line.gif'></td></tr>
<? } else { ?>
<tr height=25>
<td>&nbsp;&nbsp;&nbsp; · 배 송</td>
<td align=center>:</td>
<td style="color:red;">무 료</td>
</tr>
<tr><td colspan=3 height=1 background='<?=$g4[shop_img_path]?>/dot_line.gif'></td></tr>
<? } ?>

===============================================================================================
/shop/cartupdate.php 에 아래 내용을 추가 합니다. (저는 126번째 줄)

        // 포인트 사용하지 않는다면
        if (!$config[cf_use_point]) $_POST[it_point][$i] = 0;

if($_POST[it_cost_case]=="선불") {
$it_amt[$i] = $_POST[it_amount][$i] + $_POST[it_cost_limit];
} else {
$it_amt[$i] = $_POST[it_amount][$i];
}


        // 장바구니에 Insert
        $sql = " insert $g4[yc4_cart_table]
                    set on_uid      = '$tmp_on_uid',
                        it_id        = '{$_POST[it_id][$i]}',
                        ct_status    = '쇼핑',
                        ct_amount    = '{$it_amt[$i]}',
                        ct_point    = '{$_POST[it_point][$i]}',
                        ct_point_use = '0',
                        ct_stock_use = '0',
                        ct_qty      = '{$_POST[ct_qty][$i]}',
                        ct_time      = '$g4[time_ymdhis]',
                        ct_ip        = '$REMOTE_ADDR' ";
        sql_query($sql);
    }
}

====================== 234번 줄 ============================================
    // 포인트 사용하지 않는다면
    if (!$config[cf_use_point]) { $_POST[it_point] = 0; }


if($_POST[it_cost_case]=="선불") {
$it_amt = $_POST[it_amount] + $_POST[it_cost_limit];
} else {
$it_amt = $_POST[it_amount];
}

    // 장바구니에 Insert
    $sql = " insert $g4[yc4_cart_table]
                set on_uid      = '$tmp_on_uid',
                    it_id        = '$_POST[it_id]',
                    it_opt1      = '$_POST[it_opt1]',
                    it_opt2      = '$_POST[it_opt2]',
                    it_opt3      = '$_POST[it_opt3]',
                    it_opt4      = '$_POST[it_opt4]',
                    it_opt5      = '$_POST[it_opt5]',
                    it_opt6      = '$_POST[it_opt6]',
                    it_cost_case      = '$_POST[it_cost_case]',
                    it_cost_limit      = '$_POST[it_cost_limit]',
                    ct_status    = '쇼핑',
                    ct_amount    = '$it_amt',
                    ct_point    = '$_POST[it_point]',
                    ct_point_use = '0',
                    ct_stock_use = '0',
                    ct_qty      = '$_POST[ct_qty]',
                    ct_time      = '$g4[time_ymdhis]',
                    ct_ip        = '$REMOTE_ADDR',
                    ct_direct    = '$sw_direct' ";
    sql_query($sql);
}


===========================================================================================
/shop/cartsub.inc.php 파일에 아래 내용을 추가 합니다.

50번 줄
// $s_on_uid 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
                a.it_opt1,
                a.it_opt2,
                a.it_opt3,
                a.it_opt4,
                a.it_opt5,
                a.it_opt6,
                a.ct_amount,
                a.ct_point,
                a.it_cost_case,
                a.it_cost_limit,
                a.ct_qty,
                a.ct_status,
                b.it_id,
                b.it_name,
                b.ca_id
          from $g4[yc4_cart_table] a,
                $g4[yc4_item_table] b
          where a.on_uid = '$s_on_uid'
            and a.it_id  = b.it_id
          order by a.ct_id ";
$result = sql_query($sql);

================================================== 104번 줄
    $it_cost_case = $row[it_cost_case];
    $it_cost_limit = $row[it_cost_limit];


==================================================== 126번 줄
    // 수량, 입력(수량)
    if ($s_page == "cart.php")
        echo "<td align=center><input type=text id='ct_qty_{$i}' name='ct_qty[{$i}]' value='$row[ct_qty]' size=4 maxlength=6 class=ed style='text-align:right;' autocomplete='off'></td>";
    else
        echo "<td align=center>$row[ct_qty]</td>";

    echo "<td align=center>" . number_format($row[ct_amount]);
if($it_cost_case=="선불") {
echo " ( 배송 : ".$it_cost_case."  / ".$it_cost_limit." 원 포함)</td>";
} else {
echo "</td>";
}

  echo "<td align=right>" . number_format($sell_amount) . "</td>";
    echo "<td align=right>" . number_format($point) . "&nbsp;</td>";


============================================================================================

도움이 되셨길 바랍니다.

영카트 의뢰 작업을 하던 중 많은 부분에서 영카트의 기능을 손 보게 되네요.
새로운 그누보드와 영카트를 탄생 시키고 있는 것 같습니다.

*********************************************
* 그누보드 + 영카트 / PHP, Mysql 작업 가능  *
*                        쪽지 주세요                      * 
*********************************************

댓글목록

등록된 댓글이 없습니다.

전체 59
게시물 검색
그누보드 목록
번호 제목 글쓴이 조회 날짜
39 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3988 03-26
열람중 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3964 01-31
37 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3945 11-15
36 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3935 07-16
35 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3914 11-29
34 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3794 06-14
33 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3759 02-21
32 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3711 08-20
31 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3694 07-21
30 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3684 12-25
29 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3628 03-13
28 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3597 05-06
27 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3549 04-15
26 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3356 10-15
25 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3071 11-06
24 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3037 10-21
23 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3008 10-21
22 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3002 02-23
21 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2891 06-14
20 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2680 02-03