【问题标题】:GoogleShopping Magento Error:GoogleShopping Magento 错误:
【发布时间】:2012-09-12 12:38:56
【问题描述】:

我已经在 Magento 1.7.0.2 商店上安装并配置了 Mage_GoogleShopping 模块。尝试将产品添加到 Google 购物时,/var/log/system.log 显示以下错误:

2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePrice.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePrice.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(): Failed opening 'Mage/GoogleShopping/Model/Attribute/SalePrice.php' for inclusion (include_path='/path/to/shop/httpdocs/app/code/local:/path/to/shop/httpdocs/app/code/community:/path/to/shop/httpdocs/app/code/core:/path/to/shop/httpdocs/lib:.:')  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateFrom.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateFrom.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(): Failed opening 'Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateFrom.php' for inclusion (include_path='/path/to/shop/httpdocs/app/code/local:/path/to/shop/httpdocs/app/code/community:/path/to/shop/httpdocs/app/code/core:/path/to/shop/httpdocs/lib:.:')  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTo.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTo.php): failed to open stream: No such file or directory in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(): Failed opening 'Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTo.php' for inclusion (include_path='/path/to/shop/httpdocs/app/code/local:/path/to/shop/httpdocs/app/code/community:/path/to/shop/httpdocs/app/code/core:/path/to/shop/httpdocs/lib:.:')  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/Name.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/Name.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(): Failed opening 'Mage/GoogleShopping/Model/Attribute/Name.php' for inclusion (include_path='/path/to/shop/httpdocs/app/code/local:/path/to/shop/httpdocs/app/code/community:/path/to/shop/httpdocs/app/code/core:/path/to/shop/httpdocs/lib:.:')  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/Description.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(Mage/GoogleShopping/Model/Attribute/Description.php): failed to open stream: No such file or directory  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93
2012-09-12T12:31:27+00:00 ERR (3): Warning: include(): Failed opening 'Mage/GoogleShopping/Model/Attribute/Description.php' for inclusion (include_path='/path/to/shop/httpdocs/app/code/local:/path/to/shop/httpdocs/app/code/community:/path/to/shop/httpdocs/app/code/core:/path/to/shop/httpdocs/lib:.:')  in /path/to/shop/httpdocs/lib/Varien/Autoload.php on line 93

这个问题已经在 Magento 论坛上报告过好几次了,但是我还没有找到解决办法。

权限绝对没问题。文件不存在。

【问题讨论】:

标签: magento magento-1.7 google-shopping-api google-shopping


【解决方案1】:

GoogleShopping-Module 尝试“即时”加载所有需要的属性的属性模型。如果此模型在 Mage/GoogleShopping/Model/Attributes/... 中不存在,则会出现错误...

要覆盖此类“Mage_GoogleShopping_Model_Type”中的方法“_createAttribute”,请为我修复它:

 /**
 * Create attribute instance using attribute's name
 *
 * @param string $name
 * @return Mage_GoogleShopping_Model_Attribute
 */
protected function _createAttribute($name)
{
    $modelName = 'googleshopping/attribute_' . $this->_prepareModelName($name);
    $useDefault = false;

    $className = Mage::app()->getConfig()->getModelClassName($modelName);

    if (class_exists($className)) {
        $attributeModel = Mage::getModel($modelName);
        $useDefault = !$attributeModel;
    } else {
        $useDefault = true;
    }
    if ($useDefault) {
        $attributeModel = Mage::getModel('googleshopping/attribute_default');
    }
    $attributeModel->setName($name);

    return $attributeModel;
}

【讨论】:

    猜你喜欢
    • 2013-02-11
    • 2011-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多