collocationgoods.phtml 1.89 KB
<?php 
$field = 'less';
if (!empty($params['skn_list'])){//穿搭
	$data_list = $params['skn_list'];
	$imgSize = '90x120';
	$brand = QINProduct_Models_Brand_Client::getAllBrand('all');
	$field = 'max';
}
if (!empty($data_list)) {
	foreach ($data_list as $key => $val) {
		$key = QINProduct_Models_Product_Client::getProductIdByProductSkn($val);
		$price = QINProduct_Models_Price_Client::getPrice($key);
		if(empty($price)){
			continue;
		}
		$goodsList = QINProduct_Models_Goods_Client::getValidGoodsByProduct($key);
		if(empty($goodsList)){
			continue;
		}
		$selectColor = 0;
		$showGoods = QLibView_Sidebar::selectGoodsByColor($goodsList,$selectColor);
		$product = QINProduct_Models_Product_Client::getOneProduct($key,$field);
		$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 class="clearfix"><b>
	                    <dl>
	                         <dt><a href="<?php echo $showUrl;?>">
	                         <img src="<?php echo $showProductImg;?>" alt="<?php echo $product['product_name'];?>" /></a></dt>
	                        <dd><p><?php print Q_Utils_String::format()->mbSubstr( $product['product_name'],15);?></p><p style="color:#999999"><?php print $brand[$product['brand_id']]['brand_name'];?></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></dd>
	                        <dd><a class="go" href="<?php echo $showUrl;?>"></a></dd>
	                    </dl></b>
	                </li>    
	<?php }
	}?>