ecshop批量打印快递单
2009-07-30 09:31 来源:www.chinab4c.com 作者:ecshop专家
在ecshop后台系统中,在订单的详细页面,可以打印快递单,是一些和ecshop订单相关的资料.在配送方式列表中,你可以设置他的打印模板.
首先,修改order_list.htm加上一按扭.
<input name="print_shopping" type="submit" id="btnSubmit5" value="快速打印快递" class="button" disabled="true" onclick="this.form.target = '_blank'" />用来批量打印快递单.
在ecshop后台的order.php中加入
elseif (isset($_POST['print_shopping'])){
$region_array = array();
$region_id = !empty($_CFG['shop_country']) ? $_CFG['shop_country'] . ',' : '';
$region_id .= !empty($_CFG['shop_province']) ? $_CFG['shop_province'] . ',' : '';
$region_id .= !empty($_CFG['shop_city']) ? $_CFG['shop_city'] . ',' : '';
$region_id = substr($region_id, 0, -1);
$region = $db->getAll("SELECT region_id, region_name FROM " . $ecs->table("region") . " WHERE region_id IN ($region_id)");
if (!empty($region))
{
foreach($region as $region_data)
{
$region_array[$region_data['region_id']] = $region_data['region_name'];
}
}
$smarty->assign('shop_name', $_CFG['shop_name']);
$smarty->assign('province', $region_array[$_CFG['shop_province']]);
$smarty->assign('city', $region_array[$_CFG['shop_city']]);
$smarty->assign('shop_address', $_CFG['shop_address']);
$smarty->assign('service_phone',$_CFG['service_phone']);
//以上是系统参数
$order_sn_list = explode(',', $_POST['order_id']);
foreach ($order_sn_list as $order_sn)
{
/* 取得订单信息 */
$order = order_info(0, $order_sn);
$smarty -> assign('order',$order);
$shipping_print = $db->getOne("SELECT shipping_print FROM " . $ecs->table("shipping") . " WHERE shipping_id=" . $order['shipping_id']);
if (!empty($shipping_print))
{
echo $smarty->fetch("str:$shipping_print");
}
else
{
$shipping_code = $db->getOne("SELECT shipping_code FROM " . $ecs->table('shipping') . " WHERE shipping_id=" . $order['shipping_id']);
include_once(ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php');
if (!empty($_LANG['shipping_print']))
{
echo $smarty->fetch("str:$_LANG[shipping_print]");
}
else
{
echo $_LANG['no_print_shipping'];
}
}
}
exit;
}
以上程序用来打印快递单的。
相关文章:
来源:中国B4C电子商务
最近更新
常用插件
- ecshop通用红包编码
很多时候,为了结合促销,必须扩展一下ecshop的红包功能。ecshop的红包...
- ecshop红包修改成满多少减
我们在长期使用ecshop的时候,我们可以发现。ecshop的红包是一个非常强...
- ecshop降价通知登记插件
ecshop降价通知登记插件,主要是为了方便某些客户,对商品价格要求比...
- ecshop分类树中统计商品数
最近忙于开发其他项目,在不少朋友不断要求和催促的情况下,做出了该小...
- ecshop购物车功能改进[插件
ecshop购物车功能改进[插件套餐]主要是我们最近开发工作和开发项目中。...