- 정보공유
[영카트팁] 영카트 배송비까지 비과세 적용하기
수정 파일
/shop/orderform.sub.php
/mobile/shop/orderform.sub.php
아래 자바스크립트 함수수정
function calculate_tax()
{
var $it_prc = $("input[name^=it_price]");
var $cp_prc = $("input[name^=cp_price]");
var sell_price = tot_cp_price = 0;
var it_price, cp_price, it_notax;
var tot_mny = comm_free_mny = tax_mny = vat_mny = 0;
var send_cost = parseInt($("input[name=od_send_cost]").val());
var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
var od_coupon = parseInt($("input[name=od_coupon]").val());
var send_coupon = parseInt($("input[name=od_send_coupon]").val());
var temp_point = 0;
$it_prc.each(function(index) {
it_price = parseInt($(this).val());
cp_price = parseInt($cp_prc.eq(index).val());
sell_price += it_price;
tot_cp_price += cp_price;
it_notax = $("input[name^=it_notax]").eq(index).val();
if(it_notax == "1") {
comm_free_mny += (it_price - cp_price);
} else {
tot_mny += (it_price - cp_price);
}
});
if($("input[name=od_temp_point]").length)
temp_point = parseInt($("input[name=od_temp_point]").val()) || 0;
//tot_mny += (send_cost + send_cost2 - od_coupon - send_coupon - temp_point);
tot_mny += (od_coupon - send_coupon - temp_point); // wetoz
if(tot_mny < 0) {
comm_free_mny = comm_free_mny + tot_mny;
tot_mny = 0;
}
comm_free_mny += send_cost + send_cost2; // wetoz
tax_mny = Math.round(tot_mny / 1.1);
vat_mny = tot_mny - tax_mny;
$("input[name=comm_tax_mny]").val(tax_mny);
$("input[name=comm_vat_mny]").val(vat_mny);
$("input[name=comm_free_mny]").val(comm_free_mny);
}
수정 파일
/lib/shop.lib.php
get_order_info 함수수정
// 과세, 비과세 금액정보
$tax_mny = $sum['tax_mny'];
$free_mny = $sum['free_mny'];
if($od['od_tax_flag']) {
$tot_tax_mny = ( $tax_mny + $send_cost + $od['od_send_cost2'] )
- ( $od_coupon + $od_send_coupon + $od['od_receipt_point'] );
if($tot_tax_mny < 0) {
$free_mny += $tot_tax_mny;
$tot_tax_mny = 0;
}
} else {
$tot_tax_mny = ( $tax_mny + $free_mny + $send_cost + $od['od_send_cost2'] )
- ( $od_coupon + $od_send_coupon + $od['od_receipt_point'] );
$free_mny = 0;
}
$od_tax_mny = round($tot_tax_mny / 1.1);
$od_vat_mny = $tot_tax_mny - $od_tax_mny;
$od_free_mny = $free_mny + $send_cost;