欢迎光临
我们一直在努力

ecshop批量打印快递单

在ecshop后台系统中,在订单的详细页面,可以打印快递单,是一些和ecshop订单相关的资料.在配送方式列表中,你可以设置他的打印模板.

首先,修改order_list.htm加上一按扭.

      <input name="print_shopping" type="submit" id="btnSubmit5" value="快速打印快递" 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;
    }
赞(0) 打赏
未经允许不得转载:程序开发爱好者 » ecshop批量打印快递单
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网站设计及开发、微应用及微网站开发、微信公众平台开发、 HTML5手机网站开发、网络整合营销、APP开发、软件开发及企业电商服务

联系我们