2011-10-08 81 views
1

我正在使用Magento擴展來控制我的色板。該模塊還控制目錄列表縮略圖。我有使用調整大小的經驗,但目前似乎沒有工作。Magento - 如何調整產品縮略圖的大小

在開發模式下,我已經啓用模板路徑提示,它告訴我,它在前端/.../默認/模板/目錄/產品/ list.phtml(典型的目錄)

問題:在點擊,圖像默認爲正確的尺寸。但是,當我點擊縮略圖時,他們調整到135x135(傾斜,和更低的水庫)。

我的產品,電網list.phtml:

<ul class="products-grid"> 
    <?php endif ?> 
     <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>"> 
      <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img id="<?php echo $_product->getId();?>" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(146,196); ?>" width="146" height="196" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a> 
      <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2> 
      <?php echo $this->getLayout()->createBlock("colorselectorplus/listswatch")->setTemplate("colorselectorplus/listswatches.phtml")->setData('product', $_product)->toHtml(); ?> 
      <?php if($_product->getRatingSummary()): ?> 
      <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?> 
      <?php endif; ?> 
      <?php echo $this->getPriceHtml($_product, true) ?> 

     </li> 
    <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?> 
    </ul> 

如果我是正確的,這應該是由

resize(146,196) 

是否有可能是控制的onclick圖像是由不同的PHTML裝?

謝謝!讓我知道你是否需要一個URL。 (我們還沒有住) enter image description here
enter image description here

我所接觸的作者,閱讀常見問題解答。我還沒有聽到迴應。

+0

將很高興看到這在行動。彈出式菜單中的圖像可以加載到media.phtml模板中 – Zifius

+2

您是否嘗試過聯繫色板擴展的作者?他們可能會有關於設置圖像尺寸的常見問題。 – clockworkgeek

+0

我已經在我的分類列表中更新了該問題的圖片。 – danchet

回答

0

此修復程序位於與我們安裝的模塊有關的本地文件中。就像編輯調整寬度/高度一樣簡單,但不是存儲在用戶友好的區域。

4

我遇到了同樣的問題,並聯繫了Amasty支持。 這是他們發給我的解決方案,因爲上述解決方案不是解決方案。

我們的顏色色板這個文件將圖像尺寸調整(線78-85): 應用程序\代碼\本地\ Amasty \的conf \塊\目錄\產品\查看\型號\ Configurable.php

$parentProduct = Mage::getModel('catalog/product')->load($simple->getParentId()); 
if($parentProduct){ 
    $confData[$strKey]['parent_image'] =(string)($this->helper('catalog/image')->init($parentProduct, 'small_image')->resize(135)); 
    if(!('no_selection' == $simple->getSmallImage() || '' == $simple->getSmallImage())){ 
     $confData[$strKey]['small_image'] = (string)($this->helper('catalog/image')->init($simple, 'small_image')->resize(135)); 
    } 
    else{ 
     $confData[$strKey]['small_image'] = (string)($this->helper('catalog/image')->init($parentProduct, 'small_image')->resize(135)); 
    } 
} 
+0

感謝您發佈此信息。 – danchet

+0

有些人沒有更好的辦法與他們的時間,然後巨魔的網站.. –

+0

感謝您的電子郵件...我只是回顧'第一次海報',你的來了。我的編輯已被其他成員審閱並一致通過 - 請參閱http://stackoverflow.com/review/suggested-edits/2266921。在這裏張貼代碼時,通常的做法是格式化你的代碼 - 我並不是說它有任何不敬之處。 – rog

相關問題