zen cart 订单搜索修改
2010-09-12 23:27 来源:www.chinab4c.com 作者:admin
zen cart这个系统。确实非常强大.zen cart 订单搜索修改主要是为了增加zen cart会员中心订单搜索功能.道理很简单.zen cart和ecshop一样.都不方便在会员中心搜索订单.如果一个会员订单多了。那么就非常麻烦.通过zen cart 订单搜索插件,分析 zencart订单结构.我们可以让zen cart会员中心更加强大。
1:zencart
includes/modules/pages/account_history/header_php.php
if(isset($_GET['order_sn']) && $_GET['order_sn']){
$where.=" and o.orders_id = '".$_GET['order_sn']."'";
}
if(isset($_GET['delivery_name']) && $_GET['delivery_name']){
$where.=" and o.delivery_name = '".$_GET['delivery_name']."'";
}
$orders_total = zen_count_customer_orders('',true,$where);
$history_query_raw = "SELECT o.orders_id, o.date_purchased, o.delivery_name,
o.billing_name, ot.text as order_total, s.orders_status_name
FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s
WHERE o.customers_id = :customersID
AND o.orders_id = ot.orders_id
AND ot.class = 'ot_total'
$where
AND o.orders_status = s.orders_status_id
AND s.language_id = :languagesID
ORDER BY orders_id DESC";
2:includes/templates/template_default/templates/tpl_account_history_default.php
<form action="http://localhost/zen/index.php?main_page=account_history" method="get">
order_sn:<input type="text" name="order_sn">
<br>
delivery_name:<input type="text" name="delivery_name">
<input type="submit" value="search">
</form>
3:incudes/functions/functions_customers.php
function zen_count_customer_orders($id = '', $check_session = true,$where ='') {
global $db;
if (is_numeric($id) == false) {
if ($_SESSION['customer_id']) {
$id = $_SESSION['customer_id'];
} else {
return 0;
}
}
if ($check_session == true) {
if ( ($_SESSION['customer_id'] == false) || ($id != $_SESSION['customer_id']) ) {
return 0;
}
}
$orders_check_query = "select count(*) as total
from " . TABLE_ORDERS . " o
where o.customers_id = '" . (int)$id . "' $where";
$orders_check = $db->Execute($orders_check_query);
return $orders_check->fields['total'];
}
相关插件:
最近更新
常用插件
- ecshop分类树中统计商品数
最近忙于开发其他项目,在不少朋友不断要求和催促的情况下,做出了该小...
- ecshop降价通知登记插件
ecshop降价通知登记插件,主要是为了方便某些客户,对商品价格要求比...
- ecshop通用红包编码
很多时候,为了结合促销,必须扩展一下ecshop的红包功能。ecshop的红包...
- ecshop购物车功能改进[插件
ecshop购物车功能改进[插件套餐]主要是我们最近开发工作和开发项目中。...
- ecshop红包修改成满多少减
我们在长期使用ecshop的时候,我们可以发现。ecshop的红包是一个非常强...