当我为 Magento 网店运行 cron.php 时,我看到以下错误:
PHP 致命错误:在第 86 行的 app/code/core/Mage/CatalogRule/Model/Observer.php 中的非对象上调用成员函数 getEvent()
这是一个 Magento 1.6.2 网上商店。
这是第 86 行:
$product = $observer->getEvent()->getProduct();
这是出现错误的函数:
public function processFrontFinalPrice($observer)
{
$product = $observer->getEvent()->getProduct();
$pId = $product->getId();
$storeId = $product->getStoreId();
if ($observer->hasDate()) {
$date = $observer->getEvent()->getDate();
} else {
$date = Mage::app()->getLocale()->storeTimeStamp($storeId);
}
if ($observer->hasWebsiteId()) {
$wId = $observer->getEvent()->getWebsiteId();
} else {
$wId = Mage::app()->getStore($storeId)->getWebsiteId();
}
if ($observer->hasCustomerGroupId()) {
$gId = $observer->getEvent()->getCustomerGroupId();
} elseif ($product->hasCustomerGroupId()) {
$gId = $product->getCustomerGroupId();
} else {
$gId = Mage::getSingleton('customer/session')->getCustomerGroupId();
}
$key = "$date|$wId|$gId|$pId";
if (!isset($this->_rulePrices[$key])) {
$rulePrice = Mage::getResourceModel('catalogrule/rule')
->getRulePrice($date, $wId, $gId, $pId);
$this->_rulePrices[$key] = $rulePrice;
}
if ($this->_rulePrices[$key]!==false) {
$finalPrice = min($product->getData('final_price'), $this->_rulePrices[$key]);
$product->setFinalPrice($finalPrice);
}
return $this;
}
Magento核心代码没有做任何修改
有谁知道出了什么问题?