제작 의뢰

XE 공식사이트에 개설된 제작의뢰/제작지원 게시판을 통한 거래시 피해나 분쟁이 발생했을 경우, XE 운영팀은 관여를 하지 않으며 모든 책임은 거래 당사자들에게 있습니다.

거래시 [피해/분쟁 예방] 좋은 거래를 위한 제작/의뢰 가이드를 숙지하여 의뢰자와 제작자 모두가 분쟁 없이 좋은 결과물을 얻을 수 있기를 바랍니다.

안녕하세요~ 가비아 퍼스트몰에서 쇼핑몰을 운영하고있습니다.

퍼스트몰 기능중에 쿠폰 발급기능이 있는데요

이게 적용되는게 한상품당 한개의 쿠폰만 사용이 가능합니다.

소비자에게 여러개의 쿠폰을 발금하고 한상품당 여러개의 쿠폰을 적용해서 할인받을 수 있게끔 하고싶습니다.

아래는 해당 쿠폰 페이지 html 입니다.  수정가능하신분 연락주세요 바로 해결 원합니다.

간단한 용돈벌이로 5만원 정도 생각하고 있습니다.

댓글에 전화번호와 성함 말쓰해주시면 바로 전화드릴께요 급한거라서요

---------------------------------------------------------------------------------------------------------------------------
<link rel="stylesheet" type="text/css" href="/admin/css/style.css" charset="euc-kr" />
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/plugin/ui.datepicker.js"></script>
<div class="description" style="margin: 10px 0 5px 0"> 주문상품</div>
<table class="b_tb " width="100%" cellspacing="0" >
    <thead>
        <tr>
            <th>상품명</th>
            <th width="15%">상품가격</th>
            <th width="15%">수량</th>
            <th width="20%">쿠폰</th>
            <th width="20%">쿠폰할인액</th>
        </tr>
    </thead>
    <tbody>
        {@ cart_list}
            <tr align="center">
                <td>{.goods_name}</td>
                <td>{=number_format(.price)}원</td>
                <td>{=number_format(.quantity)}개</td>
                <td align="left">
                    <select name="coupon_info[]">
                        <option value="">:::사용 가능 쿠폰을 선택하세요::: </option>
                    {@ (coupon_list)}
                        {? ..issue_target != '0004'}
                            {? ..issue_target == '0001' // 전체상품 적용}
                                <option value="{..coupon_seq}||{..price}||{..price_type}||{..type}||{.price * .quantity}||{.goods_name}">{..name}</option>
                            {: ..issue_target == '0002' // 개별상품 적용}
                                <?php
                                    $issue_target_item = {..issue_target_item};
                                    $goods_seq = {.goods_seq};
                                    $goods_price = {.price} * {.quantity};
                                    $goods_name = {.goods_name};
                                    $coupon_name = {..name};
                                    $coupon_seq = {..coupon_seq};
                                    $coupon_price = {..price};
                                    $coupon_type = {..type};
                                    $coupon_price_type = {..price_type};
                                    $issue_target_item_limit = {..issue_target_item_limit};
                                    $items = explode(',', rtrim($issue_target_item, ','));
                                    $goods_name = str_replace("'", "", $goods_name);
                                    $goods_name = str_replace("\"", "", $goods_name);
                                    if($issue_target_item_limit == 'N') {
                                        // 해당상품만 적용
                                        if(in_array($goods_seq, $items)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        }
                                    } else {
                                        // 해당 상품 제외한 모든 상품 적용
                                        if(!in_array($goods_seq, $items)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        }
                                    }
                                ?>
                            {: ..issue_target == '0003' // 상품분류 적용}
                                <?php
                                    $issue_target_category = {..issue_target_category};
                                    $goods_price = {.price} * {.quantity};
                                    $goods_name = {.goods_name};
                                    $category_seq = {.category_code};
                                    $coupon_name = {..name};
                                    $coupon_seq = {..coupon_seq};
                                    $coupon_price = {..price};
                                    $coupon_type = {..type};
                                    $coupon_price_type = {..price_type};
                                    $issue_target_category_limit = {..issue_target_category_limit};
                                    $categorys = explode(',', rtrim($issue_target_category, ','));
                                    $goods_name = str_replace("'", "", $goods_name);
                                    $goods_name = str_replace("\"", "", $goods_name);
                                    if($issue_target_category_limit == 'N') {
                                        // 해당분류만 적용
                                        if(in_array($category_seq, $categorys)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        } else {
                                            $category_count = 0;
                                            for ($j = 0 ; $j < count($categorys); $j++) {
                                                if(strpos($category_seq, $categorys[$j]) !== false && (int)strpos($category_seq, $categorys[$j]) == 0) {
                                                    $category_count++;
                                                }
                                            }
                                            if($category_count > 0) {
                                                echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'+ '>$coupon_name</option>";
                                            }
                                        }
                                    } else {
                                        // 해당 분류 제외한 모든 상품 적용
                                        if(!in_array($category_seq, $categorys)) {
                                            $category_count = 0;
                                            for ($j = 0 ; $j < count($categorys) ; $j++) {
                                                if(strpos($category_seq, $categorys[$j]) !== false && (int)strpos($category_seq, $categorys[$j]) == 0) {
                                                    $category_count++;
                                                }
                                            }
                                            if($category_count < 1) {
                                                echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                            }
                                        }
                                    }
                                ?>
                            {/}
                        {/}
                    {/}
                    </select>
                </td>
                <td><span class="price_container"></span></td>
            </tr>
            <td>{.goods_name}</td>
                <td>{=number_format(.price)}원</td>
                <td>{=number_format(.quantity)}개</td>
                <td align="left">
                    <select name="coupon_info[]">
                        <option value="">:::사용 가능 쿠폰을 선택하세요::: </option>
                    {@ (coupon_list)}
                        {? ..issue_target != '0004'}
                            {? ..issue_target == '0001' // 전체상품 적용}
                                <option value="{..coupon_seq}||{..price}||{..price_type}||{..type}||{.price * .quantity}||{.goods_name}">{..name}</option>
                            {: ..issue_target == '0002' // 개별상품 적용}
                                <?php
                                    $issue_target_item = {..issue_target_item};
                                    $goods_seq = {.goods_seq};
                                    $goods_price = {.price} * {.quantity};
                                    $goods_name = {.goods_name};
                                    $coupon_name = {..name};
                                    $coupon_seq = {..coupon_seq};
                                    $coupon_price = {..price};
                                    $coupon_type = {..type};
                                    $coupon_price_type = {..price_type};
                                    $issue_target_item_limit = {..issue_target_item_limit};
                                    $items = explode(',', rtrim($issue_target_item, ','));
                                    $goods_name = str_replace("'", "", $goods_name);
                                    $goods_name = str_replace("\"", "", $goods_name);
                                    if($issue_target_item_limit == 'N') {
                                        // 해당상품만 적용
                                        if(in_array($goods_seq, $items)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        }
                                    } else {
                                        // 해당 상품 제외한 모든 상품 적용
                                        if(!in_array($goods_seq, $items)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        }
                                    }
                                ?>
                            {: ..issue_target == '0003' // 상품분류 적용}
                                <?php
                                    $issue_target_category = {..issue_target_category};
                                    $goods_price = {.price} * {.quantity};
                                    $goods_name = {.goods_name};
                                    $category_seq = {.category_code};
                                    $coupon_name = {..name};
                                    $coupon_seq = {..coupon_seq};
                                    $coupon_price = {..price};
                                    $coupon_type = {..type};
                                    $coupon_price_type = {..price_type};
                                    $issue_target_category_limit = {..issue_target_category_limit};
                                    $categorys = explode(',', rtrim($issue_target_category, ','));
                                    $goods_name = str_replace("'", "", $goods_name);
                                    $goods_name = str_replace("\"", "", $goods_name);
                                    if($issue_target_category_limit == 'N') {
                                        // 해당분류만 적용
                                        if(in_array($category_seq, $categorys)) {
                                            echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                        } else {
                                            $category_count = 0;
                                            for ($j = 0 ; $j < count($categorys); $j++) {
                                                if(strpos($category_seq, $categorys[$j]) !== false && (int)strpos($category_seq, $categorys[$j]) == 0) {
                                                    $category_count++;
                                                }
                                            }
                                            if($category_count > 0) {
                                                echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                            }
                                        }
                                    } else {
                                        // 해당 분류 제외한 모든 상품 적용
                                        if(!in_array($category_seq, $categorys)) {
                                            $category_count = 0;
                                            for ($j = 0 ; $j < count($categorys) ; $j++) {
                                                if(strpos($category_seq, $categorys[$j]) !== false && (int)strpos($category_seq, $categorys[$j]) == 0) {
                                                    $category_count++;
                                                }
                                            }
                                            if($category_count < 1) {
                                                echo "<option value='{$coupon_seq}||{$coupon_price}||{$coupon_price_type}||{$coupon_type}||{$goods_price}||{$goods_name}'>$coupon_name</option>";
                                            }
                                        }
                                    }
                                ?>
                            {/}
                        {/}
                    {/}
                    </select>
                </td>
                <td><span class="price_container"></span></td>
        {:}
            <tr>
                <td align="center" height="30" colspan="5">주문하려는 상품정보가 없습니다.</td>
            </tr>
        {/}
    </tbody>
</table>
<div class="description" style="text-align: right; margin-top: 5px">
    장바구니 쿠폰사용
    <select id="coupon_cart" name="coupon_cart">
        <option value="">쿠폰선택
        {@ coupon_list}
            {? .issue_target == '0004'}
                <option value="{.coupon_seq}||{.price}||{.price_type}||{.type}||{settle_price}">{.name}</option>
            {/}
        {/}
    </select>
</div>
<div class="description" style="margin: 50px 0 5px 0">  나의 쿠폰 보유현황</div>
<table class="b_tb " width="100%" cellspacing="0" >
    <thead>
        <tr>
            <th>쿠폰명</th>
            <th width="10%">속성</th>
            <th width="15%">할인율</th>
            <th width="20%">적용대상</th>
            <th width="20%">사용기간</th>
        </tr>
    </thead>
    <tbody>
        {@ coupon_list}
            <tr align="center">
                <td>{.name}</td>
                <td>{? .type == '0001'}할인{:}적립{/}</td>
                <td>{=number_format(.price)}{? .price_type == '0001'}원{:}%{/}</td>
                <td>{.issue_target_desc}</td>
                <td>{.use_date_desc}</td>
            </tr>
        {:}
            <tr>
                <td align="center" height="30" colspan="5">사용가능한 쿠폰이 없습니다.</td>
            </tr>
        {/}
    </tbody>
</table>
<input type="hidden" name="coupon_apply_code" id="coupon_apply_code"/> <input type="hidden" name="dc_coupon" id="dc_coupon"/> <input type="hidden" name="add_emoney" id="add_emoney"/> <input type="hidden" name="coupon_val" id="coupon_val"/> <p style="text-align:center">
    <img src="/admin/images/btn/btn_confirm.jpg" id="coupon_apply" style="cursor: pointer"/>
    <img src="/admin/images/btn/btn_cancel.jpg" id="coupon_cancel" style="cursor: pointer"/> </p>

<!--가이드예제 시작-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td width="5" height="5"><img src="/admin/images/t_line01.gif" width="5" height="5"></td>
        <td background="/admin/images/t_line05.gif"></td>
        <td width="5"><img src="/admin/images/t_line02.gif" width="5" height="5"></td>
    </tr>
    <tr>
        <td background="/admin/images/t_line06.gif">&nbsp;</td>
        <td style=" padding: 5px;">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="107"><img src="/admin/images/g_tit03.gif" width="97" height="18"></td>
                </tr>
            </table>
            <table border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td class="tx11_g">
                        1. 각 상품별로 사용 가능한 쿠폰만 선택하실 수 있습니다.<br/>
                        2. 할인 쿠폰은 상품당 한개씩의 쿠폰만 사용하실 수 있습니다.<br/>
                        3. 장바구니 쿠폰 사용시 다른 쿠폰을 사용할 수 없습니다.<br/>
                    </td>
                </tr>
            </table>
        </td>
        <td background="/admin/images/t_line07.gif">&nbsp;</td>
    </tr>
    <tr>
        <td height="5"><img src="/admin/images/t_line03.gif" width="5" height="5"></td>
        <td background="/admin/images/t_line08.gif"></td>
        <td><img src="/admin/images/t_line04.gif" width="5" height="5"></td>
    </tr>
</table>
<!--가이드예제 끝-->
<script type="text/javascript">     jq(document).ready(function() {
        jq('#coupon_cancel').click(function() {
           window.close();
        });
        jq('#coupon_apply').click(function() {
            if(jq("#coupon_apply_code").val()) {
                opener.jq("#coupon_apply_code").val(jq("#coupon_apply_code").val());
                opener.jq("#dc_coupon").val(jq("#dc_coupon").val());
                opener.jq("#add_emoney").val(jq("#add_emoney").val());
                opener.jq("#coupon_val").val(jq("#coupon_val").val());
                var sale_text =  setComma(jq("#dc_coupon").val()) + " 할인 ";
                var add_text =  jq("#add_emoney").val() ? setComma(jq("#add_emoney").val()) + " 적립 " : '';
                opener.jq("#coupon_apply_contents").html(sale_text + " " + add_text);
                self.close();
            } else {
                alert('사용 가능 쿠폰을 선택하지 않았습니다.');
            }
        });
        // 장바구니 쿠폰 사용시
        jq("#coupon_cart").change(function() {
            // 초기화
            jq("#coupon_apply_code").val('');
            jq("#dc_coupon").val('');
            jq("#add_emoney").val('');
            jq("#coupon_val").val('');
            jq("select[name^=coupon_info]").each(function(e, data) {
                jq("select[name=coupon_info[]]").eq(e).val('');
                jq("select[name=coupon_info[]]").eq(e).parent().next().text('');
            });

            if(this.value) {
                var coupon_info = this.value.split("||");
                var coupon_apply_code_string = coupon_info[0] + "***주문상품||";
                var coupon_price_val = coupon_info[2];
                // 할인
                if(coupon_info[3] == '0001') {
                    if(coupon_info[2] == '0001') {
                        if(  (parseInt(coupon_info[4]) - parseInt(coupon_info[1])) > 0 ) {
                            var sale_price = coupon_info[1];
                        } else {
                            var sale_price = coupon_info[4];
                        }
                    } else {
                        var sale_price = parseInt(coupon_info[4]) * (parseInt(coupon_info[1]) / 100);
                        sale_price = Math.floor(sale_price);
                    }
                    var add_emoney = 0;
                } else {
                    // 적립
                    var sale_price = 0;
                    if(coupon_info[2] == '0001') {
                        if(  (parseInt(coupon_info[4]) - parseInt(coupon_info[1])) > 0 ) {
                            var add_emoney = coupon_info[1];
                        } else {
                            var add_emoney = coupon_info[4];
                        }
                    } else {
                        var add_emoney = parseInt(coupon_info[4]) * (parseInt(coupon_info[1]) / 100);
                        add_emoney = Math.floor(add_emoney);
                    }
                }
                jq("#coupon_apply_code").val(coupon_apply_code_string);
                jq("#dc_coupon").val(sale_price);
                jq("#add_emoney").val(add_emoney);
                jq("#coupon_val").val(coupon_price_val);
            }
        });

        jq("select[name^=coupon_info]").change(function(e) {
            jq("select[name=coupon_cart]").val('');
            var selected_index = jq("select[name^=coupon_info]").index(this);
            var value_array = this.value.split("||");
            var selected = value_array[0]+"||"+value_array[1]+"||"+value_array[2]+"||"+value_array[3];
            // 할인쿠폰인 경우
            if(value_array[3] == '0001') {
                if(value_array[2] == '0001') {
                    if( (parseInt(value_array[4]) - parseInt(value_array[1])) > 0 )  {
                        var sale_price = value_array[1];
                    } else {
                        var sale_price = value_array[4];
                    }
                } else {
                    var sale_price = parseInt(value_array[4]) * (parseInt(value_array[1]) / 100);
                    sale_price = Math.floor(sale_price);
                }
                var add_emoney = 0;
            } else if(value_array[3] == '0002') {
                var sale_price = 0;
                if(value_array[2] == '0001') {
                    if(  (parseInt(value_array[4]) - parseInt(value_array[1])) > 0 ) {
                        var add_emoney = value_array[1];
                    } else {
                        var add_emoney = value_array[4];
                    }
                } else {
                    var add_emoney = parseInt(value_array[4]) * (parseInt(value_array[1]) / 100);
                    add_emoney = Math.floor(add_emoney);
                }
            }
            if(!this.value) {
                var sale_price = 0;
                var add_emoney = 0;
            }
            jq("select[name^=coupon_info]").each(function(e, data) {
                var value_check_array = this.value.split("||");
                var value_check = value_check_array[0]+"||"+value_check_array[1]+"||"+value_check_array[2]+"||"+value_check_array[3];
               if(e != selected_index && value_check == selected && this.value) {
                   alert('다른 상품에 적용된 쿠폰입니다.');
                   jq("select[name=coupon_info[]]").eq(selected_index).val('');
                   jq("select[name=coupon_info[]]").eq(selected_index).parent().next().text('');
                   return false;
               } else {
                   if(value_check_array[3] == '0001') {
                        if(e == selected_index) jq("select[name=coupon_info[]]").eq(selected_index).parent().next().text(setComma(sale_price) + '원');
                   } else if (value_check_array[3] == '0002') {
                        if(e == selected_index) jq("select[name=coupon_info[]]").eq(selected_index).parent().next().text(setComma(add_emoney) + '적립');
                   }
               }
               if(!sale_price && !add_emoney) {
                   jq("select[name=coupon_info[]]").eq(selected_index).parent().next().text('');
               }
            });
            var coupon_apply_code_string = '';
            var coupon_total_sale_price = 0;
            var coupon_total_emoney_price = 0;
            var coupon_price_val = '';
            jq("select[name^=coupon_info]").each(function(e, data) {
                var coupon_info = this.value.split("||");
                if(coupon_info[0]) coupon_apply_code_string = coupon_apply_code_string + coupon_info[0] + "***" + coupon_info[5] + "||";
                if(coupon_info[2]) coupon_price_val = coupon_price_val +  coupon_info[2];
                var price = jq("select[name=coupon_info[]]").eq(e).parent().next().text().replace(/[","]/g, '');
                if(coupon_info[3] == '0001') {
                    price = price.replace(/원/g, '');
                    if(price) coupon_total_sale_price = parseInt(coupon_total_sale_price) + parseInt(price);
                } else {
                    price = price.replace(/적립/g, '');
                    if(price) coupon_total_emoney_price = parseInt(coupon_total_emoney_price) + parseInt(price);
                }
            });
            jq("#coupon_apply_code").val(coupon_apply_code_string);
            jq("#dc_coupon").val(coupon_total_sale_price);
            jq("#add_emoney").val(coupon_total_emoney_price);
            jq("#coupon_val").val(coupon_price_val);

        });
    });
</script>