本文整理汇总了PHP中get_item_sendcost函数的典型用法代码示例。如果您正苦于以下问题:PHP get_item_sendcost函数的具体用法?PHP get_item_sendcost怎么用?PHP get_item_sendcost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_item_sendcost函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
}
// 배송비
switch ($row['ct_send_cost']) {
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if ($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id);
if ($sendcost == 0) {
$ct_send_cost = '무료';
}
}
?>
<li class="sod_li">
<input type="hidden" name="it_id[<?php
echo $i;
?>
]" value="<?php
echo $row['it_id'];
?>
">
<input type="hidden" name="it_name[<?php
示例2: sql_fetch
$sum = sql_fetch($sql);
// 배송비
switch ($row['ct_send_cost']) {
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if ($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od['od_id']);
if ($sendcost == 0) {
$ct_send_cost = '무료';
}
}
for ($k = 0; $opt = sql_fetch_array($res); $k++) {
$opt_msg = $opt['ct_option'];
if ($opt['pt_msg1']) {
$opt_msg .= '<div style="color:#888;">';
if ($row['pt_msg1']) {
$opt_msg .= $row['pt_msg1'] . ' : ';
}
$opt_msg .= $opt['pt_msg1'] . '</div>';
}
if ($opt['pt_msg2']) {
$opt_msg .= '<div style="color:#888;">';
示例3: get_sendcost
function get_sendcost($cart_id, $selected = 1)
{
global $default, $g5;
$send_cost = 0;
$total_price = 0;
$total_send_cost = 0;
$sql = " select distinct it_id\n from {$g5['g5_shop_cart_table']}\n where od_id = '{$cart_id}'\n and ct_send_cost = '0'\n and ct_status IN ( '쇼핑', '주문', '입금', '준비', '배송', '완료' )\n and ct_select = '{$selected}' ";
$result = sql_query($sql);
for ($i = 0; $sc = sql_fetch_array($result); $i++) {
// 합계
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,\n SUM(ct_qty) as qty\n from {$g5['g5_shop_cart_table']}\n where it_id = '{$sc['it_id']}'\n and od_id = '{$cart_id}'\n and ct_status IN ( '쇼핑', '주문', '입금', '준비', '배송', '완료' )\n and ct_select = '{$selected}'";
$sum = sql_fetch($sql);
$send_cost = get_item_sendcost($sc['it_id'], $sum['price'], $sum['qty'], $cart_id);
if ($send_cost > 0) {
$total_send_cost += $send_cost;
}
if ($default['de_send_cost_case'] == '차등' && $send_cost == -1) {
$total_price += $sum['price'];
}
}
$send_cost = 0;
if ($default['de_send_cost_case'] == '차등' && $total_price > 0) {
// 금액별차등 : 여러단계의 배송비 적용 가능
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
$send_cost_list = explode(";", $default['de_send_cost_list']);
$send_cost = 0;
for ($k = 0; $k < count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($total_price < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
$send_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
break;
}
}
}
return $total_send_cost + $send_cost;
}
示例4: apms_order
//.........这里部分代码省略.........
}
// 정산일 반영
$query .= ", pt_datetime = '{$now}'";
// 히스토리에 남김 - 히스토리에 남길때는 작업|아이디|시간|IP|그리고 나머지 자료
$ct_history = "\n{$ct_status}|automation|{$now}|";
$query .= ", ct_history = CONCAT(ct_history,'{$ct_history}')";
// 멤버쉽 아이템 체크 - 멤버쉽 함수가 있을 때만 작동
if (function_exists('apms_membership_order')) {
apms_membership_order($row, $ct_status, $now);
}
} else {
// 자동처리 아닌 상품
$arr_no_auto[] = $row['it_id'];
}
//커미션, 인센티브
if (USE_PARTNER) {
if ($it['pt_id']) {
// 판매자
list($commission, $incentive) = apms_pt_rate($apms, $it['pt_it'], $it['pt_id'], $it['pt_commission'], $it['pt_incentive']);
$row['pt_commission_rate'] = $commission ? $commission : 0;
$row['pt_incentive_rate'] = $incentive ? $incentive : 0;
// 가정산
$account = apms_account($row);
$query .= " , pt_id = '{$it['pt_id']}'\n\t\t\t\t\t\t\t, pt_commission_rate = '{$row['pt_commission_rate']}'\n\t\t\t\t\t\t\t, pt_incentive_rate = '{$row['pt_incentive_rate']}'\n\t\t\t\t\t\t\t, pt_sale = '{$account['sale']}'\n\t\t\t\t\t\t\t, pt_commission = '{$account['commission']}'\n\t\t\t\t\t\t\t, pt_point = '{$account['point']}'\n\t\t\t\t\t\t\t, pt_incentive = '{$account['incentive']}'\n\t\t\t\t\t\t\t, pt_net = '{$account['net']}' ";
}
if ($mk_id && isset($it['pt_marketer']) && $it['pt_marketer'] > 0) {
// 추천인
$mk_prate = $it['pt_marketer'] / 100;
$mk_amount = $row['ct_price'] * $row['ct_qty'];
//총금액
if ($row['ct_notax']) {
$mk_net = $mk_amount;
} else {
list($mk_net) = apms_vat($mk_amount);
}
$mk_profit = floor($mk_net * $mk_prate);
if ($mk_profit > 0) {
$mk_benefit = floor($mk_profit * $mk_brate);
$query .= " , mk_id = '{$mk_id}'\n\t\t\t\t\t\t\t\t, mk_profit = '{$mk_profit}'\n\t\t\t\t\t\t\t\t, mk_benefit = '{$mk_benefit}' ";
}
}
}
if ($query) {
$sql = " update {$g5['g5_shop_cart_table']} \n\t\t\t\t\t\tset pt_it = '{$it['pt_it']}'\n\t\t\t\t\t\t\t{$query} \n\t\t\t\t\t\twhere od_id = '{$od_id}' and ct_id = '{$row['ct_id']}'\n\t\t\t\t\t";
sql_query($sql);
}
}
// 판매량 일괄반영
if (is_array($arr_it_id) && !empty($arr_it_id)) {
$unq_it_id = array_unique($arr_it_id);
foreach ($unq_it_id as $it_id) {
$row2 = sql_fetch(" select sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where it_id = '{$it_id}' and ct_status = '완료' ");
sql_query(" update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row2['sum_qty']}' where it_id = '{$it_id}' ");
}
}
// 주문서가 자동처리 상품으로 되어 있으면 주문서도 완료처리
$is_sendcost = true;
if ($od_ok && is_array($arr_no_auto) && empty($arr_no_auto)) {
$info = get_order_info($od_id);
if ($info && $info['od_misu'] == 0) {
sql_query(" update {$g5['g5_shop_order_table']} set od_status = '완료' where od_id = '{$od_id}' ");
$is_sendcost = false;
}
}
// 개별배송비처리 - 무료가 아니고 기본배송비가 있는 경우만 체크
if ($is_sendcost) {
$where_sql = !empty($g5['apms_automation']) ? " and pt_it not in (" . implode(', ', $g5['apms_automation']) . ") " : "";
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '{$od_id}' and ct_select = '1' {$where_sql} group by it_id order by ct_id ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,\n\t\t\t\t\t\t\tSUM(ct_point * ct_qty) as point,\n\t\t\t\t\t\t\tSUM(ct_qty) as qty\n\t\t\t\t\t\tfrom {$g5['g5_shop_cart_table']}\n\t\t\t\t\t\twhere it_id = '{$row['it_id']}'\n\t\t\t\t\t\t and od_id = '{$od_id}' ";
$sum = sql_fetch($sql);
// 배송비
$sc_price = 0;
switch ($row['ct_send_cost']) {
case 1:
$sc_type = '착불';
break;
case 2:
$sc_type = '무료';
break;
default:
$sc_type = '선불';
$sc_price = $row['it_sc_price'];
break;
}
// 조건부무료
if ($sc_price && $row['it_sc_type'] == 2) {
$sc_price = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id);
if ($sc_price == 0) {
$sc_type = '무료';
}
}
// 개별배송비 등록
sql_query(" insert into {$g5['apms_sendcost']} set od_id = '{$od_id}', it_id = '{$row['it_id']}', pt_id = '{$row['pt_id']}', sc_price = '{$sc_price}', sc_type = '{$sc_type}', sc_datetime = '" . G5_TIME_YMDHIS . "' ", false);
}
}
return;
}