ecshop订单快递单批量打印二次开发教程
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
ECSHOP本身是有打印快递单功能的,但是需要一个一个订单的打印,如果订单多了就烦了通过本教程可以实现批量打印快递单教程开始:1.admin\templates\order_list.htm,在1后,添加12.admin\order.php,在12 /* 去发货 */ elseif (isset($_POST['to_delivery']))前,添加//批量打印快递单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 = array(); $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 = $db->getOne("SELECT * FROM " . $ecs->table("shipping") . " WHERE shipping_id=" . $order['shipping_id']); if (empty($shipping['shipping_print'])) { echo $smarty->fetch("str:" . $shipping['shipping_print']); } else { $shipping_code = $db->getOne("SELECT shipping_code FROM " . $ecs->table('shipping') . " WHERE shipping_id=" . $order['shipping_id']); if ($shipping_code){ 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;}3.这是最重要的一点,其他地方根本没说过,害得作者君我折腾了两三天。闲话不多说,切入正题,如果你使用过 系统设置→配送方式→对应模板下的‘编辑打印模板’那么你可能会发现,你的‘批量打印快递单’按钮打印出来的内容和详情里面的‘打印快递单’打印出来的内容不一样,这是因为我们新设置的打印快单使用的模版并不是新编辑过的模板,而是系统默认的老模板,解决的方法也很简单,将老模板也改成新模板的样式就好了。具体在languages\zh_cn\shipping中对应的php文件里$_LANG['shipping_print'] =‘’;这一句,将‘’中的内容样式修改过来就好了。至于取页面样式,只要在对应页面Ctrl+S一下就好了,批量打印快递单就是这么简单,小伙伴们快去试试吧!
最近更新
常用插件
- ecshop二次开发商品购买备
ecshop销售统计 插件介绍:ecshop二次开发订单销售统计和商品购买备注服...
- ecshop2.7.2退换货申请插件
ecshop2.7.2退换货申请插件,主要是在 ecshop 现在的基础上,对ecshop的订单处...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop注册推荐送现金插件
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,...
- ecshop会员中心订单excel倒出
ecshop会员中心订单excel倒出...