且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

magento捆绑产品进口

更新时间:2023-11-30 11:28:28

您将需要使用Magento数据流(系统->导入/导出->数据流-高级配置文件).创建一个新的配置文件,并为您的配置文件操作XML添加以下内容:

You'll need to use the Magento Dataflow (System -> Import/Export -> Dataflow - Advanced Profiles). Create a new profile, and add in the following for your Profile Actions XML:

<action type="dataflow/convert_adapter_io" method="load">
    <var name="type">file</var>
    <var name="path">var/import</var>
    <var name="filename"><![CDATA[name_of_file.csv]]></var>
    <var name="format"><![CDATA[csv]]></var>
</action>

<action type="dataflow/convert_parser_csv" method="parse">
    <var name="delimiter"><![CDATA[,]]></var>
    <var name="enclose"><![CDATA["]]></var>
    <var name="fieldnames">true</var>
    <var name="store"><![CDATA[0]]></var>
    <var name="number_of_records">1</var>
    <var name="decimal_separator"><![CDATA[.]]></var>
    <var name="adapter">catalog/convert_adapter_productimport</var>
    <var name="method">parse</var>
</action>

接下来,您将要创建一个包含以下字段的CSV文件:store, websites, attribute, type, sku, name, price, bundle_options, bundle_selections和要上传的其他任何字段.

Next you'll want to create a CSV file with the following fields: store, websites, attribute, type, sku, name, price, bundle_options, bundle_selections and any other fields you want to upload.

现在是棘手的部分:填写这些字段.捆绑软件选项的格式如下:product1_name,selection_type,default_qty,position|product2_name,selection_type,default_qty,position.所以看起来像product1,radio,1,0|product2,radio,1,0

Now comes the tricky part: filling in those fields. The bundle options are in the following format: product1_name,selection_type,default_qty,position|product2_name,selection_type,default_qty,position. So it will look like product1,radio,1,0|product2,radio,1,0

Bundle_selections有点难,但是看起来像这样:

Bundle_selections is a bit tougher, but looks like this:

product1_sku:0:0.0000:1:1.0000:0|product2_sku:0:0.0000:1:1.0000:

示例CSV文件

商店,网站,属性集,类型,类别ID,SKU,名称,价格,简短描述,描述,值,图像,小图像,缩略图,保证书,重量,税种ID,邮政信箱,状态,可见性,分组的,捆绑选项,捆绑选择,价格类型,sku_type admin,基本",默认值,捆绑包,7,product_sku,我的产品名称,此处的详细描述",此处的另一个描述",此处的价格提供",/image.png,/image.png,/image.png,更多文本",19,无,否,已启用,目录,搜索","Name1,radio,1,0 | Name2,radio,1,0",Sku1:0:0.0000:1: 1.0000:0 | Sku2:0:0.0000:1:1.0000:,0,1

store,websites,attribute_set,type,category_ids,sku,name,price,short_description,description,value_offer,image,small_image,thumbnail,guarantee,weight,tax_class_id,po_box,status,visibility,grouped,bundle_options,bundle_selections,price_type,sku_type admin,"base",Default,bundle,7,product_sku,My Product Name,,"Really long description here","Another description bit here","value offer here",/image.png,/image.png,/image.png,"more text",19,None,no,Enabled,"Catalog, Search",,"Name1,radio,1,0|Name2,radio,1,0",Sku1:0:0.0000:1:1.0000:0|Sku2:0:0.0000:1:1.0000:,0,1