您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop首页怎么调用积分商城里面的商品
雷友水2025-01-17 20:50:17ecshop商城教程已有人查阅
导读一、调用热门积分商品的函数。二、 //调用积分商城的商品,在index.php中加入。三、显示模板,在index.dwt中加入
一、调用热门积分商品的函数
/**
* 获得积分商城热门商品
*
* @param int $maxtop 列出条数
* @return array
*/
function exchange_gets_goods($maxtop)
{
/* 获得热门积分商品列表 */
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, eg.exchange_integral, '
.' g.goods_type,g.goods_brief, g.goods_thumb, g.goods_img, eg.is_hot '
.' FROM `ecshop`.`ecshop_exchange_goods` AS eg LEFT JOIN `ecshop`.`ecshop_goods` AS g ON g.goods_id = eg.goods_id LEFT JOIN `ecshop`.`ecshop_brand` AS b ON b.brand_id = g.brand_id '
.' WHERE eg.is_exchange = 1 AND g.is_delete = 0 AND eg.is_hot = 1 ORDER BY g.sort_order, g.last_update DESC limit ';
$sql.=$maxtop;
$res = $GLOBALS['db']->getAll($sql);
$arr = array();
foreach($res AS $idx => $row)
{
$arr[$idx]['name'] = $row['goods_name'];
$arr[$idx]['goods_brief'] = $row['goods_brief'];
$arr[$idx]['goods_style_name'] = add_style($row['goods_name'],$row['goods_name_style']);
$arr[$idx]['exchange_integral'] = $row['exchange_integral'];
$arr[$idx]['type'] = $row['goods_type'];
$arr[$idx]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
$arr[$idx]['goods_img'] = get_image_path($row['goods_id'], $row['goods_img']);
$arr[$idx]['url'] = build_uri('exchange_goods', array('gid'=>$row['goods_id']), $row['goods_name']);
}
return $arr;
}
->
二、 //调用积分商城的商品,在index.php中加入
$smarty -> assign('goods_exchange_list',exchange_gets_goods(6));
三、显示模板,在index.dwt中加入
<!--积分商城列表-->
<div class="modTitle clearfix">
<span class="left"></span><span class="right"></span>
<div class="f_l">积分兑换</div>
<div class="more">
<a href="/exchange.php" target="_blank"><img src="../images/bnt_more_1.gif" class="more" alt="更多"></a></div>
</div>
<div class="modBox clearfix">
<!--{foreach name=goods_exchange_list from=$goods_exchange_list item=exchange_goods}-->
<div class="goodsMod">
<a href="{$exchange_goods.url}" target="_blank"><img src="{$exchange_goods.goods_thumb}" alt="{$exchange_goods.goods_name}" /></a><br />
<p><a href="{$exchange_goods.url}" target="_blank">
<!-- {if $exchange_goods.goods_style_name} -->
<font class="f3">{$exchange_goods.goods_style_name}</font><br />
<!-- {else} -->
<font class="f3">{$exchange_goods.goods_name}</font><br />
<!-- {/if} -->
</a>
<!-- {if $exchange_goods.goods_brief} -->
{$lang.goods_brief}{$exchange_goods.goods_brief}<br />
<!-- {/if} --></p>
{$lang.exchange_integral}<font class="price">{$exchange_goods.exchange_integral}</font>
</div>
<!--{/foreach}-->
</div>
本文标签:
很赞哦! ()
相关文章
随机图文
-
ecshop相关配件怎么增加购买按钮
1.打开goods_fittings.lbi的文件添加红部分代码 -
ecshop商城ajax调用参数说明
1、首先ecshop是如何定义ajax对象的。2、ecshop中ajax可以使用两种方式传递数据.一种是get方式,一种是post方式.3、ecshop中的 ajax可以是传递text数据,也可以是一个json对象。比如以下代码 -
ecshop属性表attribute商品属性表goods_attr货品表prduct)商品数
ecshop属性表(attribute)商品属性表(goods_attr)货品表(prduct) 商品数量的联系一个商城的商品属性存放在属性表(attribute)里 ,每个商品对应的属性在goods_attr里 -
ecshop订单提交非常慢卡问题排查解决方法
ECSHOP商城系统制作网站时,会遇到一个问题,就是提交订单非常慢,要很长时间才能提交成功,或者死活不能提交成功。一流资源网之前已经发布过一篇原分分析及解
留言与评论 (共有 条评论) |