ecshop支付宝直接支付修改
2010-09-13 22:39 来源:www.chinab4c.com 作者:admin
ecshop的购买流程,相对于其他程序.可能要稍微好些。但是ecshop购买流程还是有很多不好的因素在里面。比如购买流程其实还是过于烦琐了。我们也试图开发过ecshop直接购买插件,也开发过ecshop简单购买流程.这些无非就是对ecshop的flow.php进行修改.简化ecshop.通过对ecshop二次开发达到从简购买.所以我们今天写一段程序,关于ecshop支付宝直接支付修改.主要思路的程序在以下代码。
$goods_id = intval($_REQUEST['goods_id']);
$shop_price = get_final_price($goods_id, 1, true, array());
$goods = get_goods_info($goods_id);
include_once('includes/lib_clips.php');
include_once('includes/lib_payment.php');
include_once('includes/lib_order.php');
$pay_id = $db -> getOne("select pay_id from ".$ecs->table('payment')." where pay_code = 'alipay'");
$payment = payment_info($pay_id);
include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');
$pay_obj = new $payment['pay_code'];
//$order['order_sn'] = get_order_sn();
$order = array(
'pay_id' => $pay_id,
'user_id' => $_SESSION['user_id'],
'add_time' => gmtime(),
'order_status' => OS_UNCONFIRMED,
'shipping_status' => SS_UNSHIPPED,
'pay_status' => PS_UNPAYED,
);
//$order['order_sn'] = date("YmdHis");
$order['order_sn'] = get_order_sn();
$order['title'] = $goods['goods_name'];
$order['order_amount'] = $shop_price;
$order['goods_amount'] = $shop_price;
if($order['order_amount'] < 298){
$order['order_amount']+=10;
$order['shipping_fee'] = 10;
}
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), $order, 'INSERT');
$new_order_id = $db->insert_id();
$order['order_id'] = $new_order_id;
clear_cart();
addto_cart($goods_id, 1, array(), '');
$sql = "INSERT INTO " . $ecs->table('order_goods') . "( " .
"order_id, goods_id, goods_name, goods_sn, product_id, goods_number, market_price, ".
"goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id) ".
" SELECT '$new_order_id', goods_id, goods_name, goods_sn, product_id, goods_number, market_price, ".
"goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id".
" FROM " .$ecs->table('cart') .
" WHERE session_id = '".SESS_ID."' AND rec_type = '$flow_type' and goods_id = '$goods_id'";
$db->query($sql);
$db -> query("delete from ".$ecs->table('cart')." where goods_id = '$goods_id' and session_id = '".SESS_ID."'");
header("Location:$url");
以上是代码思路,供参考.
相关插件:
最近更新
常用插件
- ecshop红包修改成满多少减
我们在长期使用ecshop的时候,我们可以发现。ecshop的红包是一个非常强...
- ecshop购物车功能改进[插件
ecshop购物车功能改进[插件套餐]主要是我们最近开发工作和开发项目中。...
- ecshop降价通知登记插件
ecshop降价通知登记插件,主要是为了方便某些客户,对商品价格要求比...
- ecshop分类树中统计商品数
最近忙于开发其他项目,在不少朋友不断要求和催促的情况下,做出了该小...
- ecshop通用红包编码
很多时候,为了结合促销,必须扩展一下ecshop的红包功能。ecshop的红包...