产品类型无效或不支持自定义产品类型的行

Gow*_*wri 1 import magento magento-1.5

我在我的Magento商店中有自定义产品类型产品,如"可预订".所以我尝试导入3个产品,其中"_type"值为"bookable".它给我带来了错误

   Product Type is invalid or not supported in rows: 1, 2, 3
Run Code Online (Sandbox Code Playgroud)

我在核心找到了验证

应用程序/代码/核心/法师/ importexport /型号/进口/实体/ Product.php

1439年左右.

我怎么解决这个问题

提前致谢

Pet*_*han 7

有了这个错误,有两个可能的问题.

a.)你的csv中没有_type列.

我现在假设你有这个.

b.)Magento无法找到可预订的型号型号.

类型模型从该类的受保护方法_initTypeModels中的xml config加载.查看该方法,您将看到支持的模型是通过global/importexport/import_product_types配置中的节点加载的.因此无论模块包括这个可预订的产品,都需要在它的配置中添加一个节点......

<global>
    <importexport>
        <import_product_types>
            <bookable>yourModule/import_entity_product_type_bookable</bookable>
        </import_product_types>
    </importexport>
</global>
Run Code Online (Sandbox Code Playgroud)

显然你还需要创建类YourCompany_YourModule_Model_Import_Entity_Product_type_Bookable,你可以查看一个内置类中的一个例子(例如Mage_ImportExport_Model_Import_Entity_Product_Type_Simple).