http://home.phpchina.com/space.php?uid=88872&do=blog&id=183234
ecshop文件架构说明
$ui_arr = array(’register’, ‘login’, ‘profile’, ‘order_list’,‘modify‘,’order_detail’, ‘address_list’,‘collection_list’,'message_list’, ‘tag_list’, ‘get_password’,‘reset_password’, ‘booking_list’, ‘add_booking’,‘account_raply’,'account_deposit’, ‘account_log’, ‘account_detail’,‘act_account’, ‘pay’, ‘default’, ‘bonus’, ‘group_buy’,‘group_buy_detail’, ‘affiliate’,‘comment_list’,'validate_email’,'track_packages’, ‘transform_points’);
2、在下面所示代码中,增加 $smarty->assign(’allow_to_modify’,1);
if ($order['order_amount'] > 0 && $order['pay_status'] ==PS_UNPAYED && $order['shipping_status'] == SS_UNSHIPPED)
{
$payment_list = available_payment_list(false, 0, true);
$smarty->assign(’allow_to_modify’,1);
3、在“//删除订单中的商品”的方面,加入下载代码:
elseif($action==’modify’){
function multiArraySearch($needle, $haystack){
$value = false;
$x = 0;
foreach($haystack as $temp){
// print_r($temp);
$search = array_search($needle, $temp);
if (strlen($search) > 0 && $search >= 0){
$value[0] = $x;
//$value[1] = $search;
}
$x++;
}
return $value;
}
include_once(ROOT_PATH . ‘includes/lib_transaction.php’);
include_once(ROOT_PATH . ‘includes/lib_payment.php’);
include_once(ROOT_PATH . ‘includes/lib_order.php’);
include_once(ROOT_PATH . ‘includes/lib_clips.php’);
if($_REQUEST['do']=="del"){
$oid=$_REQUEST['oid'];
$gid=$_REQUEST['bid'];
$sql="select goods_price,goods_number from ".$ecs->table("order_goods")." where goods_id=$gid";
$result=$db->getrow($sql);
$order = get_order_detail($oid, $user_id);//取得订单
$sql="delete from ".$ecs->table("order_goods")." where goods_id=$gid and order_id=$oid";//删除商品
$db->query($sql);
$sql="select configure from ".$ecs->table("shipping_area")." where shipping_id=".$order['shipping_id'];
$shipping_fee=$db->getrow($sql);
$tempa=unserialize($shipping_fee['configure']);
$shipping=multiArraySearch("free_money",$tempa);
$free_money=$tempa[$shipping[0]]['value'];//找出免运费的额度
$market_price=$order['goods_amount']-$result['goods_price']*$result['goods_number'];
$inv_id=array_search($order['inv_type'],$GLOBALS['_CFG']['invoice_type']['type']);
$rate= floatval($GLOBALS['_CFG']['invoice_type']['rate'][$inv_id])/100;
$tax=$order['tax']-($result['goods_price']*$result['goods_number'])*$rate;
$addpay_fee=pay_fee($order['pay_id'],$result['goods_price']*$result['goods_number']);//删除的支付费用
$pay_fee=$order['pay_fee']-$addpay_fee;
$order_amount=$market_price-$discount+$tax+$pay_fee;
$shipping_fee=$order['shipping_fee'];
if($market_price>=$free_money){
$order_amount=$order_amount-$shipping_fee;
$shipping_fee="0.00";
}else{
if($shipping_fee<=0){
$shipping=multiArraySearch("basic_fee",$tempa);
$shipping_fee=$tempa[$shipping[0]]['value'];//找出基本运费的
$order_amount=$order_amount+$shipping_fee;
}
}