出现的错误:
当点击商品,进入商品详细页面时出现如下错误:
解决方法:
找到错误所在的地方
public function getAttributeText($attributeCode)
{
return $this->getResource()
->getAttribute($attributeCode)
->getSource()
->getOptionText($this->getData($attributeCode));
}
替换为:
public function getAttributeText($attributeCode)
{
if ($attribute = $this->getResource()->getAttribute($attributeCode)) {
return
$attribute->getSource()
->getOptionText($this->getData($attributeCode));
} else {
//Mage::log(\'attributes-errors.log\',$attributeCode);
return false;
}
}
即可。
或者参考下这里:http://www.magentocommerce.com/boards/viewthread/53871/
本文介绍了一种在商品详情页中出现的错误及其解决方案。通过修改getAttributeText方法,确保即使属性不存在也能避免程序崩溃。
2万+

被折叠的 条评论
为什么被折叠?



