我最近需要在所有类别的滑块上添加产品....
此外,我还需要产品视图的当前产品类别网址...
我需要产品列表的最新产品图片,名称,价格和类别网址...
基本上在滑块div
<div>
<div>
<span>product image</span>
<span>name</span>
<span>price</span>
<span>category url</span>
</div>
</div>
for this i used this...
$_helper = $this->helper('catalog/output');
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4))
->setOrder('created_at', 'desc');
?>
<div u="slides" style="cursor: move; position: absolute; left: 10px; top: 0px; width: 100%; height: 497px; overflow: hidden;">
<?php foreach($_productCollection as $_product) : ?>
<div>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"
>
<img u="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image') ?>" width="250" height="497"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
</div>
<?php endforeach; ?>
</div>
bt in how can i get category id of each product...
I need to link category id on product image....
答案 0 :(得分:0)
致电
获取新产品系列{{block type="catalog/product_new" column_count="6" products_count="0" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/list.phtml"}}
在此次通话中,产品将使用list.phtml
显示。
此处将此list.phtml
更改为显示产品滑块的其他文件(例如bx slider
或任何其他产品滑块)。