产品页面显示,本产品以往的订单历史

用于收藏精华贴子、网友共享的资料等。可以回复,不能发新贴。

版主: Jack

版面规则
本版面不能发新贴,可以回复

Re: 产品页面显示,本产品以往的订单历史

帖子xiao_min » 2013-08-28 18:18

tpl_also_buy.php

<?php
$sql = 'SELECT c.customers_email_address,o.customers_country,o.customers_name,o.date_purchased,op.final_price,op.products_quantity FROM '.TABLE_ORDERS_PRODUCTS.' op, '.TABLE_ORDERS.' o,'.TABLE_CUSTOMERS.' c
WHERE op.orders_id = o.orders_id
and c.customers_id = o.customers_id
AND `products_id` ='.intval($_GET['products_id']).'
GROUP BY o.customers_id,o.orders_id
ORDER BY o.date_purchased DESC'
;
$Indexproductsnum = $db->Execute ( $sql);
if ($Indexproductsnum->RecordCount () > 0) {
$Indexproducts = $db->Execute ( $sql,10);
// echo '<div class="buytitle">'.$Indexproductsnum->RecordCount ().' Who Bought This Product</div>';
echo '<div class="buytitle">Who Bought This Product.Total Items:'.$Indexproductsnum->RecordCount ().'</div>';
?>
<table id="buyerta" width="100%" cellspacing="0" cellpadding="0" border="0"><tr><th class="titlebuy buyer">buyer</th><th class="titlebuy">address</th><th class="titlebuy">quantity</th><th class="titlebuy">final price</th><th class="titlebuy">order date</th></tr>
<?php
while ( ! $Indexproducts->EOF ) {
$buy_price=$Indexproducts->fields['final_price']*$Indexproducts->fields['products_quantity'];
?>
<tr>
<td class="innerbuy"><?php
$stremail='';
$stremail=$Indexproducts->fields['customers_email_address'];
$stremail=str_replace($stremail{strpos($stremail,"@")-2}.$stremail{strpos($stremail,"@")-1}."@","**@",$stremail);
echo $stremail;

?></td>
<td class="innerbuy"><?php echo $Indexproducts->fields['customers_country']; ?></td>
<td class="innerbuy"><?php echo $Indexproducts->fields['products_quantity']; ?></td>
<td class="innerbuy"><?php echo $buy_price; ?></td>
<td class="innerbuy"><?php echo $Indexproducts->fields['date_purchased']; ?></td>
</tr>
<?php
$Indexproducts->MoveNext ();
}
echo '</table>';
}else{
// echo '<div class="buytitle">No One Bought This Product</div>';
}
?>

-----------------------------------------------------------------------------------------------------------
css代码:

.buytitle{ font-weight: bold;
margin: 5px; font-size:13px;}
.titlebuy{background: none repeat scroll 0 0 #FAFAFA;
color: #000000;
font-size: 14px;
font-weight: normal;border:1px solid #E1E1E1;padding:5px; text-align:center; width: auto; text-transform:capitalize;}
.innerbuy {border: 1px solid #E1E1E1;
padding: 5px;
text-align: center;width: auto;}
------------------------------------------------------------------
调用:
tpl_product_info_display.php适当的位置添加:
<?php require($template->get_template_dir('tpl_also_buy.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_also_buy.php');?>
头像
xiao_min
VIP会员
VIP会员
 
帖子: 355
注册: 2010-06-08 11:17

Re: 产品页面显示,本产品以往的订单历史

帖子zhanghao162 » 2013-11-01 13:48

能搞成10行一列可翻页的效果吗?
求高手。
zhanghao162
高级会员
高级会员
 
帖子: 238
注册: 2011-03-11 1:19
地址: 深圳

Re: 产品页面显示,本产品以往的订单历史

帖子jamesding88 » 2013-11-16 9:48

:D
头像
jamesding88
高级会员
高级会员
 
帖子: 100
注册: 2009-08-14 21:09
地址: BRISBANE QUEEMSLAND AUSTRALIA

Re: 产品页面显示,本产品以往的订单历史

帖子majun8030 » 2013-11-16 11:00

Oil Painting:http://www.zenzc.com/home3/
www.zenzc.com www.zen-cart.tv www.lvlve.cn
majun8030
中级会员
中级会员
 
帖子: 58
注册: 2010-05-09 1:49
地址: http://www.znezc.com
QQ 帐号: 37037738

上一页

  • 相关话题
    回复总数
    阅读次数
    最新文章

回到 精华共享



在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客

cron