求助大虾帮助解决一个小问题,支付宝给钱。

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家

我想在首页调用 ID为2的分类下属性为"精品"的商品,请问怎么写标签,20元支付宝马上交易,谢谢,QQ:5739316

回答:
自己已经处理好了,是在网上收集的,测试可用:
============在首页按分类调用指定属性的商品============
1、先在根目录找到index.php找到:
/* 页面中的动态内容 */然后增加(35、1、48为分类的ID)
hot是热销商品best精品new新品

$children = get_children(35);
$smarty->assign('chot_goods_35', get_category_recommend_goods('hot',$children)); //蛋糕分类下的热销商品
$children = get_children(1);
$smarty->assign('chot_goods_1', get_category_recommend_goods('hot',$children)); //鲜花分类下的热销商品
$children = get_children(48);
$smarty->assign('chot_goods_48', get_category_recommend_goods('hot',$children)); //礼品分类下的热销商品
然后在index.dwt调用:
<!--{foreach from=$chot_goods_1 item=goods}-->
<div style="padding-top: 8px;" class="new-tr">
<a target="_blank" href="{$goods.url}"><img width="116" height="130" border="0" alt="{$goods.name|escape:html}" src="{$goods.thumb}"></a>
<div class="right">
<a target="_blank" href="{$goods.url}">{$goods.name|escape:html}</a><br>
<span style="color: rgb(102, 102, 102); text-decoration: line-through;">市场价:{$goods.market_price}</span><br>
特卖价:<span style="color: rgb(255, 0, 0);">{$goods.shop_price}</span><br>
<span class="font-gmm"><a href="javascript:addToCart({$goods.id})">立即抢购</a></span>
</div>
<span class="new-line"></span>
</div>
<!--{/foreach}-->

自己已经处理好了,是在网上收集的,测试可用:
============在首页按分类调用指定属性的商品============
1、先在根目录找到index.php找到:
/* 页面中的动态内容 */然后增加(35、1、48为分类的ID)
hot是热销商品best精品new新品

$children = get_children(35);
$smarty->assign('chot_goods_35', get_category_recommend_goods('hot',$children)); //蛋糕分类下的热销商品
$children = get_children(1);
$smarty->assign('chot_goods_1', get_category_recommend_goods('hot',$children)); //鲜花分类下的热销商品
$children = get_children(48);
$smarty->assign('chot_goods_48', get_category_recommend_goods('hot',$children)); //礼品分类下的热销商品
然后在index.dwt调用:
<!--{foreach from=$chot_goods_1 item=goods}-->
<div style="padding-top: 8px;" class="new-tr">
<a target="_blank" href="{$goods.url}"><img width="116" height="130" border="0" alt="{$goods.name|escape:html}" src="{$goods.thumb}"></a>
<div class="right">
<a target="_blank" href="{$goods.url}">{$goods.name|escape:html}</a><br>
<span style="color: rgb(102, 102, 102); text-decoration: line-through;">市场价:{$goods.market_price}</span><br>
特卖价:<span style="color: rgb(255, 0, 0);">{$goods.shop_price}</span><br>
<span class="font-gmm"><a href="javascript:addToCart({$goods.id})">立即抢购</a></span>
</div>
<span class="new-line"></span>
</div>
<!--{/foreach}--> 支持下了

嗯,学习了,谢谢

切,自卖自夸?~