为您的magento自定义模块按照以下步骤1)为图像占位符,您可以创建文件夹 media/mymodule/placeholder/placeholderImage.jpg 2) 重写 model Class Mage_Catalog_Model_Product_Image 3) 更新方法 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.'));
}
替换为
$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.'));
}
}
(责任编辑:好模板) |


英文内衣外贸商城|ecshop英
人气:448
ecshop仿米奇化妆品商城程
人气:1349
Vintage小型电子商务MEGENT
人气:365
lumi化妆品商网店城|ecsho
人气:442
凡客成品ecshop模板普通版
人气:652
仿京东多用户商城带三级
人气:1104