ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [영카트] 포인트 사용 시 총 금액주문 반영
    코딩/그누보드5 2018. 12. 3. 15:48

    [출처] https://sir.kr/qa/236208



    /shop/orderform.sub.php 여기에서 아래와 같이 작업하시면,

    포인트 차감된 금액이 나올겁니다.


    //onKeyup="point_change(this.value);" 추가
    02<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10" onKeyup="point_change(this.value);">점 (<?php echo $point_unit; ?>점 단위로 입력하세요.)
    03  
    04<script>
    05//calculate_order_price() 수정.
    06function calculate_order_price()
    07{
    08 var send_point = 0;
    09 <?php if($temp_point > 0 && $is_member) { ?>
    10    send_point = parseInt($("input[name=od_temp_point]").val());
    11 <?php } ?>
    12 var sell_price = parseInt($("input[name=od_price]").val());
    13    var send_cost = parseInt($("input[name=od_send_cost]").val());
    14    var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
    15    var send_coupon = parseInt($("input[name=od_send_coupon]").val());
    16    var tot_price = sell_price + send_cost + send_cost2 - send_coupon;
    17    $("input[name=good_mny]").val(tot_price);
    18    $("#od_tot_price").text(number_format(String(tot_price-send_point)));
    19    <?php if($temp_point > 0 && $is_member) { ?>
    20    calculate_temp_point();
    21    <?php } ?>
    22}
    23  
    24//point_change() 추가
    25function point_change(point){
    26 if(point != ""){
    27  calculate_order_price();
    28 }
    29}
    30</script>



    643번줄 
    <input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (<?php echo $point_unit; ?>점 단위로 입력하세요.)    <-- 위 코드 대체

Designed by Tistory.