- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2017
08:27 AM
08-17-2017
08:27 AM
Animated Gifs
I'm trying to add animated gifs to my product pages through the admin. I can add them, but when I view them on the front end they just come through as the separate images. How can I fix this?
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2017
09:50 PM
08-22-2017
09:50 PM
Re: Animated Gifs
copy file from the path
app/code/core/Mage/Catalog/Model/Product/Image.php to path : app/code/local/Mage/Catalog/Model/Product/Image.php (create folders if necessary) Find the line public function getUrl() and replace the function with: 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); }
Go to admin > Cache Management and clear all cache then Refresh product.
Elsner Technologies
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2018
09:21 AM
01-28-2018
09:21 AM
Re: Animated Gifs
edit file on -> .\vendor\magento\module-catalog\Model\View\Asset\Image.php
on function getAbsolutePath($result) and private function getRelativePath($result)
check are file contain .gif or not?
if true then dont use cache image, if false use cache image.
if true then dont use cache image, if false use cache image.
=======================================
if (strpos( $this->getFilePath(), '.gif') !== false) {
$result = $this->join($result, $this->getFilePath());
}
else{
$result = $this->join($result, $this->getModule());
$result = $this->join($result, $this->getMiscPath());
$result = $this->join($result, $this->getFilePath());
}
====================