我的問題是我如何爲list.phtml文件中的懸浮圖像分配一個自定義屬性作爲圖像。Magento 1.7.0.2 List.phtml圖像懸停
我已經做了我的研究,並獲得該網站通過使用此代碼來調用網格視圖圖像上list.phtml
<a href="<?php echo $_product->getProductUrl() ?>"
title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"
class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(135); ?>"
width="135" height="135"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"
onmouseover="this.src='<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(135) ?>';"
onmouseout="this.src='<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(135) ?>';" />
</a>
如果懸停圖像被指定爲這個工程做我想做的縮略圖。
我的問題是我使用this extension來導入我的所有產品,並且它不允許爲基本,小和縮略圖分配不同的圖像。你必須使用相同的圖像。 (是的,我可以進入並單獨選擇每個圖像,並選擇縮略圖,但這不是一個選項與我有的產品數量)
好吧,我所做的是創建一個名爲懸停圖像的產品的自定義屬性,添加列到CSV文件,變戲法它的工作原理 - 這裏看到的懸停形象得到assigend下圖片的懸停圖片選項:
所以我的問題是如何編輯的行上面的代碼,所以它調用新的'hover_image'屬性,而不是縮略圖。我曾嘗試將縮略圖更改爲'hover_image',但該網站崩潰。
請幫忙,我覺得這麼近,但不是那裏。
你檢查日誌文件崩潰的原因是什麼?通常情況下,如果這是你的屬性代碼,你可以使用'$ this-> helper('catalog/image') - > init($ _ product,'hover_image')。 –
嘿,謝謝你的回覆,這裏是文件:http://dansiop.com/169764586470.txt –