标签:
For your Custom module follow following steps 1) you can create folder for placeholder images at
media/mymodule/placeholder/placeholderImage.jpg
2) re-Write model Class
Mage_Catalog_Model_Product_Image
3) Update the method
public function setBaseFile($file)
Line around at 304
$baseFile = $baseDir . $file;
if ((!$file) || (!file_exists($baseFile))) {
throw new Exception(Mage::helper(‘catalog‘)->__(‘Image file was not found.‘));
}
replace with
$baseFile = $baseDir . $file;
if ((!$file) || (!file_exists($baseFile))) {
$module = $this->getRequest()->getModuleName();
if($module==‘mymodule‘){
$baseFile = Mage::getBaseUrl(‘media‘).‘mymodule/placeholder/placeholderImage.jpg‘;
}else{
throw new Exception(Mage::helper(‘catalog‘)->__(‘Image file was not found.‘));
}
}
magento解决分类页没有产品图片报Image file was not found
标签:
原文地址:http://www.cnblogs.com/you-jia/p/4546385.html