本文整理汇总了PHP中available_shipping_list函数的典型用法代码示例。如果您正苦于以下问题:PHP available_shipping_list函数的具体用法?PHP available_shipping_list怎么用?PHP available_shipping_list使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了available_shipping_list函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_bonus
/* 取得用户可用红包 */
$user_bonus = user_bonus($order['user_id'], $order['goods_amount']);
if ($order['bonus_id'] > 0) {
$bonus = bonus_info($order['bonus_id']);
$user_bonus[] = $bonus;
}
$smarty->assign('available_bonus', $user_bonus);
}
} elseif ('invoice' == $step) {
/* 如果不存在实体商品 */
if (!exist_real_goods($order_id)) {
die('Hacking Attemp');
}
/* 取得可用的配送方式列表 */
$region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
$shipping_list = available_shipping_list($region_id_list);
// /* 取得配送费用 */
// $total = order_weight_price($order_id);
// foreach ($shipping_list AS $key => $shipping)
// {
// $shipping_fee = shipping_fee($shipping['shipping_code'],
// unserialize($shipping['configure']), $total['weight'], $total['amount'], $total['number']);
// $shipping_list[$key]['shipping_fee'] = $shipping_fee;
// $shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee);
// $shipping_list[$key]['free_money'] = price_format($shipping['configure']['free_money']);
// }
$smarty->assign('shipping_list', $shipping_list);
}
/* 显示模板 */
assign_query_info();
$smarty->display('order_step.htm');
示例2: flow_order_info
* 取得订单信息
*/
$order = flow_order_info();
$smarty->assign('order', $order);
$_LANG['shopping_money'] = '购物金额小计 %s';
$_LANG['than_market_price'] = '比市场价 %s 节省了 %s (%s)';
/*
* 计算订单的费用
*/
$total = order_fee($order, $cart_goods, $consignee);
$smarty->assign('shopping_money', sprintf($_LANG['shopping_money'], $total['formated_goods_price']));
$smarty->assign('market_price_desc', sprintf($_LANG['than_market_price'], $total['formated_market_price'], $total['formated_saving'], $total['save_rate']));
$smarty->assign('total', $total);
/* 取得配送列表 */
$region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
$shipping_list = available_shipping_list($region);
$cart_weight_price = cart_weight_price($flow_type);
$insure_disabled = true;
$cod_disabled = true;
// 查看购物车中是否全为免运费商品,若是则把运费赋为零
$sql = 'SELECT count(*) FROM ' . $ecs->table('cart') . " WHERE `session_id` = '" . SESS_ID . "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $db->getOne($sql);
foreach ($shipping_list as $key => $val) {
$shipping_cfg = unserialize_config($val['configure']);
$shipping_fee = ($shipping_count == 0 and $cart_weight_price['free_shipping'] == 1) ? 0 : shipping_fee($val['shipping_code'], unserialize($val['configure']), $cart_weight_price['weight'], $cart_weight_price['amount'], $cart_weight_price['number']);
$shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee, false);
$shipping_list[$key]['shipping_fee'] = $shipping_fee;
$shipping_list[$key]['free_money'] = price_format($shipping_cfg['free_money'], false);
$shipping_list[$key]['insure_formated'] = strpos($val['insure'], '%') === false ? price_format($val['insure'], false) : $val['insure'];
}
$smarty->assign('shipping_list', $shipping_list);
示例3: checkout
public function checkout () {
global $ecs,$db,$_CFG;
/*------------------------------------------------------ */
//-- 订单确认
/*------------------------------------------------------ */
#取得购物类型
$flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
/*
#团购标志
if ($flow_type == CART_GROUP_BUY_GOODS)
{
$smarty->assign('is_group_buy', 1);
}
#积分兑换商品
elseif ($flow_type == CART_EXCHANGE_GOODS)
{
$smarty->assign('is_exchange_goods', 1);
}
else
{
*/
#正常购物流程 清空其他购物流程情况
$_SESSION['flow_order']['extension_code'] = '';
/*}*/
/* 检查购物车中是否有商品 */
$sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE session_id = '" . SESS_ID . "' " .
"AND parent_id = 0 AND is_gift = 0 AND rec_type = '$flow_type'";
if ($db->getOne($sql) == 0)
{
$msg = rpcLang('flow.php', 'no_goods_in_cart');
jsonExit("{\"status\":\"$msg\"}");
}
/*
* 检查用户是否已经登录
* 如果用户已经登录了则检查是否有默认的收货地址
* 如果没有登录则跳转到登录和注册页面
*/
if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0)
{
$msg = rpcLang('user.php', 'nologin');
jsonExit("{\"status\":\"$msg\"}");
}
$consignee = get_consignee($_SESSION['user_id']);
#检查收货人信息是否完整
if (!check_consignee_info($consignee, $flow_type))
{
$msg = rpcLang('flow.php', 'user_address_not_full');
jsonExit("{\"status\":\"$msg\"}");
}
//$_SESSION['flow_consignee'] = $consignee;
#对商品信息赋值
$cart_goods = cart_goods($flow_type); // 取得商品列表,计算合计
/*
$smarty->assign('goods_list', $cart_goods);
#对是否允许修改购物车赋值
if ($flow_type != CART_GENERAL_GOODS || $_CFG['one_step_buy'] == '1')
{
$smarty->assign('allow_edit_cart', 0);
}
else
{
$smarty->assign('allow_edit_cart', 1);
}
#取得购物流程设置
$smarty->assign('config', $_CFG);
*/
/*
* 取得订单信息
*/
$order = flow_order_info();
/* 计算折扣 */
if ($flow_type != CART_EXCHANGE_GOODS && $flow_type != CART_GROUP_BUY_GOODS)
{
$discount = compute_discount();
}
/*
* 计算订单的费用
*/
$total = order_fee($order, $cart_goods, $consignee);
#取得配送列表
$region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
#快递方式集合
$shipping_list = available_shipping_list($region);
#购物车重量
//.........这里部分代码省略.........
示例4: get_regions
if ($order['city'] > 0) {
/* 取得区域 */
$smarty->assign('district_list', get_regions(3, $order['city']));
}
}
}
}
} elseif ('shipping' == $step) {
/* 如果不存在实体商品 */
if (!exist_real_goods($order_id)) {
die('Hacking Attemp');
}
/* 取得可用的配送方式列表 */
$region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
//$shipping_list = available_shipping_list($region_id_list);
$shipping_list = available_shipping_list($region_id_list, $order['supplier_id']);
/* 取得配送费用 */
$total = order_weight_price($order_id);
foreach ($shipping_list as $key => $shipping) {
$shipping_fee = shipping_fee($shipping['shipping_code'], unserialize($shipping['configure']), $total['weight'], $total['amount'], $total['number']);
$shipping_list[$key]['shipping_fee'] = $shipping_fee;
$shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee);
$shipping_list[$key]['free_money'] = price_format($shipping['configure']['free_money']);
}
$smarty->assign('shipping_list', $shipping_list);
} elseif ('payment' == $step) {
/* 取得可用的支付方式列表 */
if (exist_real_goods($order_id)) {
/* 存在实体商品 */
$region_id_list = array($order['country'], $order['province'], $order['city'], $order['district']);
$shipping_area = shipping_area_info($order['shipping_id'], $region_id_list);
示例5: array
$originCityCode = !empty($_REQUEST['originCityCode']) ? $_REQUEST['originCityCode'] : '';
$destCityCode = !empty($_REQUEST['destCityCode']) ? $_REQUEST['destCityCode'] : '';
$transportModel = !empty($_REQUEST['transportModel']) ? $_REQUEST['transportModel'] : '';
$postData = array(orderType => $orderType, qty => $qty, productAttr => $productAttr, qtyOfPackage => $qtyOfPackage, packWeight => $packWeight, packVolume => $packVolume, HSCode => $HSCode, originCityCode => $originCityCode, destCityCode => $destCityCode, transportModel => $transportModel);
$postUrl = "http://www.234plog.com/eCloudsService/ecshippingcost/";
//可做成配置项
echo json_encode(http_post($postUrl, $postData, $_COOKIE));
exit;
}
/*------------------------------------------------------ */
//-- PROCESSOR
/*------------------------------------------------------ */
//$sql ="select * from jindong_shipping WHERE shipping_id = 8";
//$res = $db->getAll($sql);
/*ross 在 产品详情页 显示 运费*/
$shipping_list = available_shipping_list([2]);
foreach ($shipping_list as $key => $val) {
$shipping_fee = ($shipping_count == 0 and $cart_weight_price['free_shipping'] == 1) ? 0 : shipping_fee($val['shipping_code'], unserialize($val['configure']), $goods_weight, $goods_amount, 1);
}
$goods2 = get_goods_info($goods_id);
if ($goods2['is_shipping']) {
$shipping_fee = 0;
}
$smarty->assign('shipping_fee', $shipping_fee);
/*ross 在 产品详情页 显示 运费*/
$cache_id = $goods_id . '-' . $_SESSION['user_rank'] . '-' . $_CFG['lang'];
$cache_id = sprintf('%X', crc32($cache_id));
if (!$smarty->is_cached('goods.dwt', $cache_id)) {
$smarty->assign('image_width', $_CFG['image_width']);
$smarty->assign('image_height', $_CFG['image_height']);
$smarty->assign('helps', get_shop_help());
示例6: insert_get_shop_shipping
/**
* 获取不同商家的运费方式
**/
function insert_get_shop_shipping($arr)
{
global $db, $ecs;
$need_cache = $GLOBALS['smarty']->caching;
$need_compile = $GLOBALS['smarty']->force_compile;
$order = $_SESSION['flow_order'];
//获取订单信息
$suppid = intval($arr['suppid']);
$consignee = $arr['consignee'];
$flow_type = $arr['flow_type'];
$region = array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']);
$shipping_list = available_shipping_list($region, $suppid);
$cart_weight_price = cart_weight_price2($flow_type, $suppid);
if (count($shipping_list) > 0) {
//获取当前地址下所有的配送方式
$shipping_id = array();
foreach ($shipping_list as $v) {
$shipping_id[] = $v['shipping_id'];
}
$i = 0;
$sql_where = $_SESSION['user_id'] > 0 ? "user_id='" . $_SESSION['user_id'] . "' " : "session_id = '" . SESS_ID . "' AND user_id=0 ";
$sql = 'SELECT count(*) FROM ' . $ecs->table('cart') . " WHERE {$sql_where} AND `extension_code` != 'package_buy' AND `is_shipping` = 0 AND rec_id in (" . $_SESSION['sel_cartgoods'] . ")";
//jx
$shipping_count = $db->getOne($sql);
foreach ($shipping_list as $key => $val) {
$shipping_cfg = unserialize_config($val['configure']);
$shipping_fee = $shipping_count == 0 && $cart_weight_price['free_shipping'] == 1 ? 0 : shipping_fee($val['shipping_code'], unserialize($val['configure']), $cart_weight_price['weight'], $cart_weight_price['amount'], $cart_weight_price['number']);
$shipping_list[$key]['format_shipping_fee'] = price_format($shipping_fee, false);
$shipping_list[$key]['shipping_fee'] = $shipping_fee;
$shipping_list[$key]['free_money'] = price_format($shipping_cfg['free_money'], false);
$shipping_list[$key]['insure_formated'] = strpos($val['insure'], '%') === false ? price_format($val['insure'], false) : $val['insure'];
$selected = '';
if ($i == 0 && !in_array($order['shipping_pay'][$suppid], $shipping_id)) {
$selected = 'selected';
$order['shipping_pay'][$suppid] = $val['shipping_id'];
//记录第一个被选中的配送方式的id
}
if (isset($order['shipping_pay'][$suppid]) && intval($order['shipping_pay'][$suppid]) == $val['shipping_id'] && in_array($order['shipping_pay'][$suppid], $shipping_id)) {
$selected = 'selected';
}
$shipping_list[$key]['selected'] = $selected;
// 当前的配送方式是否支持保价
if ($val['shipping_id'] == $order['shipping_id']) {
$insure_disabled = $val['insure'] == 0;
$cod_disabled = $val['support_cod'] == 0;
}
}
}
$GLOBALS['smarty']->assign('suppid', $suppid);
$GLOBALS['smarty']->assign('shipping_list', $shipping_list);
$GLOBALS['smarty']->assign('insure_disabled', $insure_disabled);
$GLOBALS['smarty']->assign('cod_disabled', $cod_disabled);
$GLOBALS['smarty']->caching = $need_cache;
$GLOBALS['smarty']->force_compile = $need_compile;
$val = $GLOBALS['smarty']->fetch('library/shipping_list.lbi');
$_SESSION['flow_order'] = $order;
return $val;
}