0 レビュー
1 回答
php-magentoのスライダーですべてのカテゴリから最近追加された製品を取得する方法
最近、すべてのカテゴリのスライダーに製品を追加する必要があります...
また、商品ビューには現在の商品カテゴリのURLが必要です...
商品リストの最新の商品画像、名前、価格、カテゴリURLが必要です...
基本的にスライダー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
レビュー
答え :
解決策:
電話して新製品コレクションを入手
{{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 または他の製品スライダー)に変更します。< / p>
わからない
同様の質問
私たちのウェブサイトで同様の質問で答えを見つけてください。