searchgoods.phtml
2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
$field = 'less';
$imgSize = '290x388';
$type = 'showskn';
$is_new = empty($params['is_new']) ? 'N' : $params['is_new'];
if (!empty($params['recom_list'])) {//推荐商品
if (!empty($params['recom_list']['recom'])) {
$data_list = $params['recom_list']['recom'];
}else if (!empty($params['recom_list']['sales'])) {//销量商品
$data_list = $params['recom_list']['sales']['match_list'];
$type = '';
}
}
if (!empty($data_list)) {
foreach ($data_list as $key => $val) {
if ($type == 'showskn') {
$key = QINProduct_Models_Product_Client::getProductIdByProductSkn($val['product_skn']);
}
$goodsList = QINProduct_Models_Goods_Client::getValidGoodsByProduct($key);
if(empty($goodsList)){
continue;
}
$price = QINProduct_Models_Price_Client::getPrice($key);
if(empty($price)){
continue;
}
$selectColor = 0;
$showGoods = QLibView_Sidebar::selectGoodsByColor($goodsList,$selectColor);
$product = QINProduct_Models_Product_Client::getOneProduct($key,$field);
$yohood = QINProduct_Models_Activities_Link_Client::getActivitiesBySkn($product['erp_product_id'], 1);
$cnAlphabet = $product['cn_alphabet'];
$showUrl = QLibConfigs_Static::$siteUrl . QINLib_Utils::getProductUrl($key, $showGoods['id'], $cnAlphabet);
$showProductImg = QINLib_Images::QFSImage($showGoods['color_image'], 'goodsimg', $imgSize, 4);
?>
<li><b>
<a href="<?php echo $showUrl;?>">
<?php if (!empty($yohood)) {?>
<div id="yohood-tag"><img src="http://static.yohobuy.com/m/v1/img/weixin/yohood_03.png" width="52"/></div>
<?php }?>
<img src="<?php echo $showProductImg;?>" alt="<?php echo $product['product_name'];?>" />
</a>
<?php if($is_new == 'Y'){?><p class="tag">新品推荐</p><?php }?>
<p class="name"><a href="<?php echo $showUrl;?>" ><?php print Q_Utils_String::format()->mbSubstr( $product['product_name'],28);?></a></p>
<p class="price"><?php if ($price['market_price'] == $price['sales_price']) {?>
¥<?php echo number_format($price['sales_price'],2);} else {?><a class="line">¥<?php echo number_format($price['market_price'], 2);?></a> <a class="red">¥<?php echo number_format($price['sales_price'], 2);?></a><?php }?></p>
</b></li>
<?php }
}?>