2013-01-04 136 views
7

我想顯示產品的動畫圖像。
上傳gif圖像是可能的,但在前端沒有看到相同的圖像。
我看到由於在magento動畫gif圖像中緩存的功能沒有看到。
我該如何實現它?
檢查this鏈接以供參考。
在此先感謝。Magento顯示動畫產品的圖像

+0

該鏈接沒有任何產品。你有這個工作嗎? – miles

+0

@miles:http://www.itsourstudio.com/hungry-hound-591 –

回答

9

您可以實施它。
雖然您的緩存功能不適用於動畫gif圖像。應用程序/代碼/核心/法師/目錄/型號/產品/ Image.php

路徑:應用程序/代碼/本地/從

路徑
拷貝文件Mage/Catalog/Model/Product/Image.php (必要時創建文件夾)
查找行public function getUrl()並用以下函數替換該函數:

public function getUrl() 
    { 
     $baseDir = Mage::getBaseDir('media'); 
     $file = ('gif' == strtolower(pathinfo($this->_baseFile, PATHINFO_EXTENSION))) ? $this->_baseFile : $this->_newFile; 
     $path = str_replace($baseDir . DS, "", $file); 
     return Mage::getBaseUrl('media') . str_replace(DS, '/', $path); 
    } 

希望這會幫助你。

+0

謝謝..它的工作就像一個魅力 –

+0

很高興幫助你 –

+2

這有幫助,但我有rezised圖像的一些問題。 – superhero

相關問題