0

我的问题是当数据分析运行时,它好像根本没有拾取covert_adapter_category ......我似乎看不到遗漏了什么......有什么想法吗?

数据流导入的输出:

Starting profile execution, please wait...
Warning: Please do not close the window during importing/exporting data

Starting Mage_Dataflow_Model_Convert_Adapter_Io :: load
Loaded successfully: "/opt/bitnami/apps/magento/htdocs/var/import/Categories.csv".
Starting Mage_Dataflow_Model_Convert_Parser_Csv :: parse
Method "parse" not defined in adapter catalog/convert_adapter_category.
Finished profile execution.

配置.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <Import_Catalog>
      <version>0.1.0</version>
    </Import_Catalog>
  </modules>
  <global>


    <models>
    <catalog>
        <rewrite>
            <convert_adapter_category>Import_Catalog_Model_Convert_Adapter_Category</convert_adapter_category>
        </rewrite>
   </catalog>

   </models>

  </global>
</config>

protected $_stores;

/**
 * Category display modes
 */
protected $_displayModes = array( 'PRODUCTS', 'PAGE', 'PRODUCTS_AND_PAGE');

public function parse()
{
    $batchModel = Mage::getSingleton('dataflow/batch');
    /* @var $batchModel Mage_Dataflow_Model_Batch */

    $batchImportModel = $batchModel->getBatchImportModel();
    $importIds = $batchImportModel->getIdCollection();

    foreach ($importIds as $importId) {
        //print '<pre>'.memory_get_usage().'</pre>';
        $batchImportModel->load($importId);
        $importData = $batchImportModel->getBatchData();

        $this->saveRow($importData);
    }
}
4

2 回答 2

1

您的 currentconfig.xml设置为Mage_Catalog_Model_Convert_Adapter_Category使用您的实现重写 Magento 的定义,Import_Catalog_Model_Convert_Adapter_Category. 不幸的Mage_Catalog_Model_Convert_Adapter_Category是,据我所知,Magento 中实际上并不存在。

我建议您更改您config.xml的模型,为您的模型定义自己的类前缀,如下所示:

<config>
    ...
    <global>
        <models>
            <customimport>
                <class>Import_Catalog_Model</class>
            </customimport>
        </models>
    </global>
    ...
</config>

customimport/convert_adapter_category然后,在您实现逻辑后,编辑您的 Dataflow 配置文件以使用名为 的适配器。

于 2012-06-22T09:32:18.377 回答
1

不要惊慌,只需刷新缓存并再次运行配置文件。这应该可以解决问题。

于 2014-04-09T14:52:34.317 回答