【问题标题】:Magento show animated gif image for productMagento 显示产品的动画 gif 图像
【发布时间】:2013-01-04 05:40:47
【问题描述】:

我想显示产品的动画 gif 图像。
上传 gif 图像是可能的,但在前端看不到相同的图像。
由于没有看到 magento 动画 gif 图像中的缓存,我看到了该功能。
我该如何实现它?
检查this链接以供参考。
提前致谢。

【问题讨论】:

标签: magento caching product animated-gif


【解决方案1】:

你可以实现它。
虽然您的缓存功能不适用于动画 gif 图像。

复制文件

路径: app/code/core/Mage/Catalog/Model/Product/Image.php

路径: app/code/local/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);
    }

希望这会对你有所帮助。

【讨论】:

  • 这有帮助,但我在调整图像时遇到了一些问题。
猜你喜欢
  • 2021-07-29
  • 1970-01-01
  • 2017-01-10
  • 1970-01-01
  • 2011-02-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-03
相关资源
最近更新 更多