[Y5] 회원가격(레벨2)/특별가격(레벨3) 적용하기 > 온라인강의

본문 바로가기
 
 
 
오늘 1,713
어제 1,606
최대 2,526
전체 3,404,583

최근 방문자

932
869
1674
1697
1606
1713
24 25 26 27 28 29
비즈니스의 시작 비즈명함 ~ 가격, 품질, 배송 3가지 만족을 드리는 비즈명함 / 즉석명함 / 급행서비스 / 서울 전지역 수도권일부 3시간배송

select * from g5_menu where me_use = '1' and me_link like '%lecture%'
온라인강좌 홈 > 온라인강좌 > 온라인강좌

영카트 | [Y5] 회원가격(레벨2)/특별가격(레벨3) 적용하기 (update. 2017-06-07)

페이지 정보

작성일2017-05-19 15:03 조회509회 댓글0건

본문

영카트4 에서 회원가격(레벨2) / 특별회원(레벨 3) 일때 다른 금액으로 보이는 기능을 영카트5에 추가합니다.
판매가격 > 비회원가격
  (추가)   > 회원가격
  (추가)   > 특별가격


1-1. 영카트5 / yc4_import_run.php

        $excl_fld = array('it_opt1_subject', 'it_opt2_subject', 'it_opt3_subject', 'it_opt4_subject', 'it_opt5_subject', 'it_opt6_subject', 'it_opt1', 'it_opt2', 'it_opt3', 'it_opt4', 'it_opt5', 'it_opt6', 'it_amount2', 'it_amount3', 'it_gallery', 'it_explan_html');

를 다음과 같이 변경

        $excl_fld = array('it_opt1_subject', 'it_opt2_subject', 'it_opt3_subject', 'it_opt4_subject', 'it_opt5_subject', 'it_opt6_subject', 'it_opt1', 'it_opt2', 'it_opt3', 'it_opt4', 'it_opt5', 'it_opt6', 'it_gallery', 'it_explan_html');


1-2. 영카트5 / yc4_import_run.php

                if($key == 'it_amount')
                    $key = 'it_price';

를 다음과 같이 변경

                if($key == 'it_amount')
                    $key = 'it_price';

                if($key == 'it_amount2')
                    $key = 'it_price2';

                if($key == 'it_amount3')
                    $key = 'it_price3';


2. 디비의  g5_shop_item 에  it_price2 , it_price3 필드를 추가

ALTER TABLE `g5_shop_item` ADD `it_price2` int(11) NOT NULL default '0' AFTER `it_price` ,
ADD `it_price3` int(11) NOT NULL default '0' AFTER `it_price2` 



3. 영카트5 / lib / shop.lib.php 

function get_price($it)
{
    global $member;

    if ($it['it_tel_inq']) return '전화문의';

    $price = $it['it_price'];

    return (int)$price;
}

를 아래와 같이 변경

function get_price($it)
{
    global $member;

    if ($it['it_tel_inq']) return '전화문의';

    if ($member['mb_level'] >= 3 && $it['it_price3'] > 0) { 
        $price = $it['it_price3']; 
    } else if ($member['mb_level'] == 2 && $it['it_price2'] > 0) { 
        $price = $it['it_price2']; 
    } else { 
        $price = $it['it_price']; 
    }

    return (int)$price;
}



4-1. 영카트5 / adm / shop_admin / itemlist.php

colspan="5"  를  colspan="6"  로 변경 합니다. ( 2개가 있습니다 )



4-2. 영카트5 / adm / shop_admin / itemlist.php

    <tr>
        <th scope="col" rowspan="2" id="th_img">이미지</th>
        <th scope="col" rowspan="2" id="th_pc_title"><?php echo subject_sort_link('it_name', 'sca='.$sca); ?>상품명</a></th>
        <th scope="col" id="th_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>판매가격</a></th>
        <th scope="col" id="th_camt"><?php echo subject_sort_link('it_cust_price', 'sca='.$sca); ?>시중가격</a></th>
        <th scope="col" id="th_skin">PC스킨</th>
    </tr>
    <tr>
        <th scope="col" id="th_pt"><?php echo subject_sort_link('it_point', 'sca='.$sca); ?>포인트</a></th>
        <th scope="col" id="th_qty"><?php echo subject_sort_link('it_stock_qty', 'sca='.$sca); ?>재고</a></th>
        <th scope="col" id="th_mskin">모바일스킨</th>
    </tr>

를 다음과 같이 변경

    <tr>
        <th scope="col" rowspan="2" id="th_img">이미지</th>
        <th scope="col" rowspan="2" id="th_pc_title"><?php echo subject_sort_link('it_name', 'sca='.$sca); ?>상품명</a></th>
        <th scope="col" id="th_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>비회원가격</a></th>
        <th scope="col" id="th_amt"><?php echo subject_sort_link('it_price2', 'sca='.$sca); ?>회원가격</a></th>
        <th scope="col" id="th_amt"><?php echo subject_sort_link('it_price3', 'sca='.$sca); ?>특별가격</a></th>
        <th scope="col" id="th_skin">PC스킨</th>
    </tr>
    <tr>
        <th scope="col" id="th_camt"><?php echo subject_sort_link('it_cust_price', 'sca='.$sca); ?>시중가격</a></th>
        <th scope="col" id="th_pt"><?php echo subject_sort_link('it_point', 'sca='.$sca); ?>포인트</a></th>
        <th scope="col" id="th_qty"><?php echo subject_sort_link('it_stock_qty', 'sca='.$sca); ?>재고</a></th>
        <th scope="col" id="th_mskin">모바일스킨</th>
    </tr>



4-3. 영카트5 / adm / shop_admin / itemlist.php

    <tr class="<?php echo $bg; ?>">
        <td rowspan="2" class="td_img"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?></a></td>
        <td headers="th_pc_title" rowspan="2" class="td_input">
            <label for="name_<?php echo $i; ?>" class="sound_only">상품명</label>
            <input type="text" name="it_name[<?php echo $i; ?>]" value="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?>" id="name_<?php echo $i; ?>" required class="frm_input required" size="30">
        </td>
        <td headers="th_amt" class="td_numbig td_input">
            <label for="price_<?php echo $i; ?>" class="sound_only">판매가격</label>
            <input type="text" name="it_price[<?php echo $i; ?>]" value="<?php echo $row['it_price']; ?>" id="price_<?php echo $i; ?>" class="frm_input sit_amt" size="7">
        </td>
        <td headers="th_camt" class="td_numbig td_input">
            <label for="cust_price_<?php echo $i; ?>" class="sound_only">시중가격</label>
            <input type="text" name="it_cust_price[<?php echo $i; ?>]" value="<?php echo $row['it_cust_price']; ?>" id="cust_price_<?php echo $i; ?>" class="frm_input sit_camt" size="7">
        </td>
        <td headers="th_skin" class="td_numbig td_input">
            <label for="it_skin_<?php echo $i; ?>" class="sound_only">PC 스킨</label>
            <?php echo get_skin_select('shop', 'it_skin_'.$i, 'it_skin['.$i.']', $row['it_skin']); ?>
        </td>
    </tr>
    <tr class="<?php echo $bg; ?>">
        <td headers="th_pt" class="td_numbig td_input"><?php echo $it_point; ?></td>
        <td headers="th_qty" class="td_numbig td_input">
            <label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고</label>
            <input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input sit_qty" size="7">
        </td>
        <td headers="th_mskin" class="td_numbig td_input">
            <label for="it_mobile_skin_<?php echo $i; ?>" class="sound_only">모바일 스킨</label>
            <?php echo get_mobile_skin_select('shop', 'it_mobile_skin_'.$i, 'it_mobile_skin['.$i.']', $row['it_mobile_skin']); ?>
        </td>
    </tr>

를 다음과 같이 변경

    <tr class="<?php echo $bg; ?>">
        <td rowspan="2" class="td_img"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?></a></td>
        <td headers="th_pc_title" rowspan="2" class="td_input">
            <label for="name_<?php echo $i; ?>" class="sound_only">상품명</label>
            <input type="text" name="it_name[<?php echo $i; ?>]" value="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?>" id="name_<?php echo $i; ?>" required class="frm_input required" size="30">
        </td>
        <td headers="th_amt" class="td_numbig td_input">
            <label for="price_<?php echo $i; ?>" class="sound_only">비회원가격</label>
            <input type="text" name="it_price[<?php echo $i; ?>]" value="<?php echo $row['it_price']; ?>" id="price_<?php echo $i; ?>" class="frm_input sit_amt" size="7">
        </td>
        <td headers="th_amt" class="td_numbig td_input">
            <label for="price2_<?php echo $i; ?>" class="sound_only">회원가격</label>
            <input type="text" name="it_price2[<?php echo $i; ?>]" value="<?php echo $row['it_price2']; ?>" id="price2_<?php echo $i; ?>" class="frm_input sit_amt" size="7">
        </td>
        <td headers="th_amt" class="td_numbig td_input">
            <label for="price3_<?php echo $i; ?>" class="sound_only">특별가격</label>
            <input type="text" name="it_price3[<?php echo $i; ?>]" value="<?php echo $row['it_price3']; ?>" id="price2_<?php echo $i; ?>" class="frm_input sit_amt" size="7">
        </td>
        <td headers="th_skin" class="td_numbig td_input">
            <label for="it_skin_<?php echo $i; ?>" class="sound_only">PC 스킨</label>
            <?php echo get_skin_select('shop', 'it_skin_'.$i, 'it_skin['.$i.']', $row['it_skin']); ?>
        </td>
    </tr>
    <tr class="<?php echo $bg; ?>">
        <td headers="th_camt" class="td_numbig td_input">
            <label for="cust_price_<?php echo $i; ?>" class="sound_only">시중가격</label>
            <input type="text" name="it_cust_price[<?php echo $i; ?>]" value="<?php echo $row['it_cust_price']; ?>" id="cust_price_<?php echo $i; ?>" class="frm_input sit_camt" size="7">
        </td>
        <td headers="th_pt" class="td_numbig td_input"><?php echo $it_point; ?></td>
        <td headers="th_qty" class="td_numbig td_input">
            <label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고</label>
            <input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input sit_qty" size="7">
        </td>
        <td headers="th_mskin" class="td_numbig td_input">
            <label for="it_mobile_skin_<?php echo $i; ?>" class="sound_only">모바일 스킨</label>
            <?php echo get_mobile_skin_select('shop', 'it_mobile_skin_'.$i, 'it_mobile_skin['.$i.']', $row['it_mobile_skin']); ?>
        </td>
    </tr>



5. 영카트5 / adm / shop_admin / itemform.php

        <tr>
            <th scope="row"><label for="it_price">판매가격</label></th>
            <td>
                <input type="text" name="it_price" value="<?php echo $it['it_price']; ?>" id="it_price" class="frm_input" size="8"> 원
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_price" value="1" id="chk_ca_it_price">
                <label for="chk_ca_it_price">분류적용</label>
                <input type="checkbox" name="chk_all_it_price" value="1" id="chk_all_it_price">
                <label for="chk_all_it_price">전체적용</label>
            </td>
        </tr>

를 다음과 같이 변경

        <tr>
            <th scope="row"><label for="it_price">비회원가격</label></th>
            <td>
                <input type="text" name="it_price" value="<?php echo $it['it_price']; ?>" id="it_price" class="frm_input" size="8"> 원
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_price" value="1" id="chk_ca_it_price">
                <label for="chk_ca_it_price">분류적용</label>
                <input type="checkbox" name="chk_all_it_price" value="1" id="chk_all_it_price">
                <label for="chk_all_it_price">전체적용</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_price2">회원가격</label></th>
            <td>
                <input type="text" name="it_price2" value="<?php echo $it['it_price2']; ?>" id="it_price2" class="frm_input" size="8"> 원
            </td>
            <td class="td_grpset">
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_price3">특별가격</label></th>
            <td>
                <input type="text" name="it_price3" value="<?php echo $it['it_price3']; ?>" id="it_price3" class="frm_input" size="8"> 원
            </td>
            <td class="td_grpset">
            </td>
        </tr>



6. 영카트5 / adm / shop_admin / itemformupdate.php

                it_price            = '$it_price',

를 다음과 같이 변경

                it_price            = '$it_price',
                it_price2           = '$it_price2',
                it_price3           = '$it_price3',



7. 영카트5 / shop / cartupdate.php

            $sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '".addslashes($it['it_name'])."', '{$it['it_sc_type']}', '{$it['it_sc_method']}', '{$it['it_sc_price']}', '{$it['it_sc_minimum']}', '{$it['it_sc_qty']}', '쇼핑', '{$it['it_price']}', '$point', '0', '0', '$io_value', '$ct_qty', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G5_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select', '$ct_select_time' )";

를 아래와 같이 변경

            if ($member['mb_level'] >= 3 && $it['it_price_3'] > 0) {
                $sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '".addslashes($it['it_name'])."', '{$it['it_sc_type']}', '{$it['it_sc_method']}', '{$it['it_sc_price']}', '{$it['it_sc_minimum']}', '{$it['it_sc_qty']}', '쇼핑', '{$it['it_price3']}', '$point', '0', '0', '$io_value', '$ct_qty', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G5_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select', '$ct_select_time' )";
            } elseif ($member['mb_level'] == 2 && $it['it_price_2'] > 0) {
                $sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '".addslashes($it['it_name'])."', '{$it['it_sc_type']}', '{$it['it_sc_method']}', '{$it['it_sc_price']}', '{$it['it_sc_minimum']}', '{$it['it_sc_qty']}', '쇼핑', '{$it['it_price2']}', '$point', '0', '0', '$io_value', '$ct_qty', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G5_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select', '$ct_select_time' )";
            } else {
                $sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '".addslashes($it['it_name'])."', '{$it['it_sc_type']}', '{$it['it_sc_method']}', '{$it['it_sc_price']}', '{$it['it_sc_minimum']}', '{$it['it_sc_qty']}', '쇼핑', '{$it['it_price']}', '$point', '0', '0', '$io_value', '$ct_qty', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G5_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select', '$ct_select_time' )";
            }


관련자료
https://sir.kr/yc5_tip/816 
https://sir.kr/yc5_tip/578 
  • 페이스북으로 보내기
  • 트위터로 보내기
  • 구글플러스로 보내기

댓글목록

등록된 댓글이 없습니다.


목록

Total 2,008건 1 페이지
온라인강의 목록
번호 제목
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
열람중
1985
1984
게시물 검색
 
 
상호: 해피정닷컴 대표:정창용 사업자등록번호:119-05-36414 (08394) 서울시 구로구 디지털로 242 한화비즈메트로1차 1502호
전화: 070-7600-3500 팩스:02-865-3528 개인정보관리:정창용 mail@happyjung.com 에스크로확인
개인정보취급방침
COPYRIGHT 2001~2017 해피정닷컴. All rights reserved. 부가통신사업신고:서울체신청-1217 통신판매신고:2014-서울구로-0074
 
모바일 버전으로 보기