You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
3.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
/**
* 到付运费插件 FPD(freight payable at destination)
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.shop.com
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: wayne $
* $Id: fpd.php 17217 2011-01-19 06:29:08Z wayne $
*/
if (!defined('IN_ASC'))
{
die('Hacking attempt');
}
$shipping_lang = ROOT_PATH.'languages/' .$GLOBALS['_CFG']['lang']. '/shipping/fpd.php';
if (file_exists($shipping_lang))
{
global $_LANG;
include_once($shipping_lang);
}
/* 模块的基本信息 */
if (isset($set_modules) && $set_modules == TRUE)
{
$i = (isset($modules)) ? count($modules) : 0;
/* 配送方式插件的代码必须和文件名保持一致 */
$modules[$i]['code'] = 'fpd';
$modules[$i]['version'] = '1.0.0';
/* 配送方式的描述 */
$modules[$i]['desc'] = 'fpd_desc';
/* 配送方式是否支持货到付款 */
$modules[$i]['cod'] = TRUE;
/* 插件的作者 */
$modules[$i]['author'] = 'shop TEAM';
/* 插件作者的官方网站 */
$modules[$i]['website'] = 'http://www.shop.com';
/* 配送接口需要的参数 */
$modules[$i]['configure'] = array();
/* 模式编辑器 */
$modules[$i]['print_model'] = 2;
/* 打印单背景 */
$modules[$i]['print_bg'] = '';
/* 打印快递单标签位置信息 */
$modules[$i]['config_lable'] = '';
return;
}
class fpd
{
/*------------------------------------------------------ */
//-- PUBLIC ATTRIBUTEs
/*------------------------------------------------------ */
/**
* 配置信息
*/
var $configure;
/*------------------------------------------------------ */
//-- PUBLIC METHODs
/*------------------------------------------------------ */
/**
* 构造函数
*
* @param: $configure[array] 配送方式的参数的数组
*
* @return null
*/
function __construct($cfg=array())
{
}
/**
* 计算订单的配送费用的函数
*
* @param float $goods_weight 產品重量
* @param float $goods_amount 產品金额
* @return decimal
*/
function calculate($goods_weight, $goods_amount)
{
return 0;
}
/**
* 查询发货状态
* 该配送方式不支持查询发货状态
*
* @access public
* @param string $invoice_sn 发货单号
* @return string
*/
function query($invoice_sn)
{
return $invoice_sn;
}
function getorder($order){
$kuaidi = sprintf($GLOBALS['_CFG']['kuaidi100'],'fpd',$order);
$result = getcontent($kuaidi);
$getdata = json_decode($result,true);
if($getdata['message']!='ok'){
$data['data'][0] = array('time'=> local_date('Y-m-d H:m:s', gmtime()),'context'=>'请等待配送员送货上门!');
}else{
$data = json_decode($result,true);
}
return $data;
}
}
?>