【发布时间】:2013-06-01 07:36:23
【问题描述】:
当我使用 magentoshop 访问页面时;我收到此错误消息:
在线/xxxxx/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php中的非对象上调用成员函数getId() 85
我前往那条线,它是名为 getTotalConfigurableItemsPrice 的函数的一部分。 它在一个 foreach 中:
它说:
foreach ($attributes as $attribute) {
$attributeId = $attribute->getProductAttribute()->getId();
而属性的东西就是问题所在。 我在 $attribute->getProductAttribute() 上尝试了 var_dump() 并收到 NULL var_dump on($attribute) 显示即
["_data":protected]=>
array(5) {
["product_super_attribute_id"]=>
string(4) "3845"
["product_id"]=>
string(8) "10001563"
["attribute_id"]=>
string(3) "135"
["position"]=>
string(1) "0"
["product_attribute"]=>
NULL
}
属性有什么问题,我该如何解决? 如果我说:
$attributeId = 1234;
而不是
$attributeId = $attribute->getProductAttribute()->getId();
错误消失了,但我需要真实值..
【问题讨论】:
-
您是否安装了任何扩展 magento 产品属性集功能的扩展?
-
否,没有安装这种方式的扩展
-
您应该接受下面的答案,因为它可以解决您的问题。
标签: magento attributes