フロントページにカスタムブロックロード製品があり、カスタム製品画像属性が設定されている4つの最新製品をロードします。
$_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(4);
私がやろうとしているのはimage_feature_front_right
、バックエンドで設定されているラベルを取得することですが、それができませんでした。フロントエンドに製品を表示するための私のコードは次のとおりです。
<?php foreach($_productCollection as $_product) : ?>
<div class="fll frontSale">
<div class="productImageWrap">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'image_feature_front_right')->directResize(230,315,4) ?>" />
</div>
<div class="salesItemInfo">
<a href="<?php echo $this->getUrl($_product->getUrlPath()) ?>"><p class="caps"><?php echo $this->htmlEscape($_product->getName());?></p></a>
<p class="nocaps"><?php echo $this->getImageLabel($_product, 'image_feature_front_right') ?></p>
</div>
</div>
私はそれがそれを行う方法であると読みました$this->getImageLabel($_product, 'image_feature_front_right')
が、何も生み出しません。私は何が間違っているのですか?
ありがとう!
トレ