我在我的頭版上有一個塊,它用一個名爲image_feature_front_right
的自定義產品圖像來抓取兩個最新產品。在Magento中抓取自定義產品圖片標籤?
我用這個代碼查詢:
$_helper = $this->helper('catalog/output');
$_productCollection = Mage::getModel("catalog/product")->getCollection();
$_productCollection->addAttributeToSelect('*');
$_productCollection->addAttributeToFilter("image_feature_front_right", array("notnull" => 1));
$_productCollection->addAttributeToFilter("image_feature_front_right", array("neq" => 'no_selection'));
$_productCollection->addAttributeToSort('updated_at', 'DESC');
$_productCollection->setPageSize(2);
我能夠得到:
- 圖像:
echo $this->helper('catalog/image')->init($_product, 'image_feature_front_right')->directResize(230,315,4)
- 產品網址:
echo $_product->getProductUrl()
- 產品名稱:
$this->stripTags($_product->getName(), null, true)
我無法得到的唯一的東西是自定義圖像標籤。我試過echo $this->getImageLabel($_product, 'image_feature_front_right')
,但這似乎什麼都不做。
任何人都可以指向正確的方向嗎?
謝謝!
Tre