Пример сложной программы импорта на языке Magento Dataflow

[16 июля 2019 г.]    Российская сборка Magento 2.52.2
Magento 2: модули и услуги
magereport.com: составление перечня необходимых для установки заплаток SUPEE
#1 Дмитрий Федюк
  • Администратор
  • Иконка
  • Группа: Администратор
  • Сообщений: 8995
  • Регистрация: 20.02.2010

02.06.2011 13:45

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


<action type="dataflow/convert_parser_xml_excel" method="parse">
    <var name="single_sheet"><![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_product</var>
    <var name="method">parse</var>
</action>


<action type="df_dataflow/convert_mapper_column" method="map">
    <var name="df-direction">import</var>
    <var name="map">

        <map name="iname"><![CDATA[name]]></map>
        <map name="productcode"><![CDATA[sku]]></map>
        <map name="price"><![CDATA[price]]></map>
        <map name="iid"><![CDATA[asos_iid]]></map>
        <map name="videos"><![CDATA[asos_videos]]></map>
        <map name="desc"><![CDATA[description]]></map>
        <map name="about"><![CDATA[short_description]]></map>
        <map name="Brand"><![CDATA[manufacturer]]></map>

        <map name="Dress Style"><![CDATA[asos_dress_style]]></map>
        <map name="Bag Type"><![CDATA[asos_bag_type]]></map>
        <map name="Gender"><![CDATA[asos_gender]]></map>
        <map name="Heel Height"><![CDATA[asos_heel_height]]></map>
        <map name="Jacket Style"><![CDATA[asos_jacket_style]]></map>
        <map name="Jean Style"><![CDATA[asos_jean_style]]></map>
        <map name="Jeans Fit"><![CDATA[asos_jeans_fit]]></map>
        <map name="Leather | Non Leather"><![CDATA[asos_is_leather]]></map>
        <map name="Product Type"><![CDATA[asos_product_type]]></map>
        <map name="Shirt Sleeve Length"><![CDATA[asos_shirt_sleeve_length]]></map>
        <map name="Shirt Style"><![CDATA[asos_shirt_style]]></map>
        <map name="Short Type"><![CDATA[asos_short_type]]></map>
        <map name="Celebrity"><![CDATA[asos_celebrity]]></map>
        <map name="Skirt Type"><![CDATA[asos_skirt_type]]></map>
        <map name="Sunglasses Style"><![CDATA[asos_sunglasses_style]]></map>
        <map name="Sunglasses Type"><![CDATA[asos_sunglasses_type]]></map>
        <map name="T-Shirt Style"><![CDATA[asos_t_shirt_style]]></map>
        <map name="Tie Style"><![CDATA[asos_tie_style]]></map>
        <map name="Tops Style"><![CDATA[asos_tops_style]]></map>
        <map name="Trouser Style"><![CDATA[asos_trouser_style]]></map>
        <map name="Underwear Style"><![CDATA[asos_underwear_style]]></map>


        <map name="imgs"><![CDATA[df_additional_images]]></map>
        <map name="cid"><![CDATA[df_categories]]></map>

        <map name="size"><![CDATA[df_custom_options [Размер]]]></map>
        <map name="colour"><![CDATA[df_custom_options [Цвет]]]></map>
    </var>
</action>


<action type="asos_dataflow/convert_mapper_category" method="map">
    <var name="df-direction">import</var>
    <var name="map">

        <map name="2623"><![CDATA[Women/New In: Clothing]]></map>
        <map name="6992"><![CDATA[Women/New In: Shoes & Accs]]></map>
        <map name="8799"><![CDATA[Women/Dresses]]></map>
        <map name="4169"><![CDATA[Women/Tops]]></map>
        <map name="4718"><![CDATA[Women/T-Shirts & Vests]]></map>
        <map name="2637"><![CDATA[Women/Knitwear]]></map>
        <map name="2641"><![CDATA[Women/Jackets & Coats]]></map>
        <map name="3630"><![CDATA[Women/Jeans]]></map>
        <map name="2640"><![CDATA[Women/Trousers & Leggings]]></map>
        <map name="2639"><![CDATA[Women/Skirts]]></map>
        <map name="9263"><![CDATA[Women/Shorts]]></map>
        <map name="7618"><![CDATA[Women/Jumpsuits & Playsuits]]></map>
        <map name="7657"><![CDATA[Women/Socks & Hosiery]]></map>
        <map name="4172"><![CDATA[Women/Shoes]]></map>
        <map name="8730"><![CDATA[Women/Bags & Purses]]></map>
        <map name="4174"><![CDATA[Women/Accessories]]></map>
        <map name="4175"><![CDATA[Women/Jewellery]]></map>
        <map name="5088"><![CDATA[Women/Watches]]></map>
        <map name="6046"><![CDATA[Women/Lingerie & Nightwear]]></map>
        <map name="2238"><![CDATA[Women/Swimwear]]></map>
        <map name="1344"><![CDATA[Women/Sports & Loungewear]]></map>
        <map name="1314"><![CDATA[Women/Beauty Shop]]></map>
        <map name="4177"><![CDATA[Women/ASOS Petite]]></map>
        <map name="9577"><![CDATA[Women/ASOS Curve]]></map>
        <map name="5813"><![CDATA[Women/ASOS Maternity]]></map>
        <map name="3930"><![CDATA[Women/Outlet\/Clearance Brands]]></map>

        <map name="6993"><![CDATA[Men/New In: Clothing]]></map>
        <map name="6994"><![CDATA[Men/New In: Shoes & Accs]]></map>
        <map name="7616"><![CDATA[Men/T-Shirts & Vests]]></map>
        <map name="10550"><![CDATA[Men/Jersey Basics]]></map>
        <map name="3602"><![CDATA[Men/Shirts]]></map>
        <map name="4616"><![CDATA[Men/Polo Shirts]]></map>
        <map name="7617"><![CDATA[Men/Jumpers & Cardigans]]></map>
        <map name="3606"><![CDATA[Men/Jackets & Coats]]></map>
        <map name="11760"><![CDATA[Men/Leather Jackets]]></map>
        <map name="5668"><![CDATA[Men/Hoodies & Sweatshirts]]></map>
        <map name="4208"><![CDATA[Men/Jeans]]></map>
        <map name="7078"><![CDATA[Men/Shorts & Swim]]></map>
        <map name="4910"><![CDATA[Men/Trousers]]></map>
        <map name="5678"><![CDATA[Men/Suits & Tailoring]]></map>
        <map name="4209"><![CDATA[Men/Shoes]]></map>
        <map name="9265"><![CDATA[Men/Bags]]></map>
        <map name="4210"><![CDATA[Men/Accessories]]></map>
        <map name="6519"><![CDATA[Men/Sunglasses]]></map>
        <map name="11330"><![CDATA[Men/Jewellery]]></map>
        <map name="5034"><![CDATA[Men/Watches]]></map>
        <map name="4030"><![CDATA[Men/Underwear & Socks]]></map>
        <map name="4415"><![CDATA[Men/Loungewear]]></map>
        <map name="3936"><![CDATA[Men/Outlet\/Clearance Brands]]></map>

        <map name="5524"><![CDATA[Outlet/Women's Outlet\/Clearance/New In: Clothing]]></map>
        <map name="8956"><![CDATA[Outlet/Women's Outlet\/Clearance/New In: Shoes & Accs]]></map>
        <map name="5235"><![CDATA[Outlet/Women's Outlet\/Clearance/Dresses]]></map>
        <map name="4167"><![CDATA[Outlet/Women's Outlet\/Clearance/Tops]]></map>
        <map name="2893"><![CDATA[Outlet/Women's Outlet\/Clearance/Knitwear]]></map>
        <map name="2110"><![CDATA[Outlet/Women's Outlet\/Clearance/Jackets & Coats]]></map>
        <map name="4331"><![CDATA[Outlet/Women's Outlet\/Clearance/Jeans]]></map>
        <map name="1928"><![CDATA[Outlet/Women's Outlet\/Clearance/Trousers & Leggings]]></map>
        <map name="3149"><![CDATA[Outlet/Women's Outlet\/Clearance/Skirts]]></map>
        <map name="12413"><![CDATA[Outlet/Women's Outlet\/Clearance/Shorts]]></map>
        <map name="9638"><![CDATA[Outlet/Women's Outlet\/Clearance/Jumpsuits & Playsuits]]></map>
        <map name="10517"><![CDATA[Outlet/Women's Outlet\/Clearance/Socks & Hosiery]]></map>
        <map name="1931"><![CDATA[Outlet/Women's Outlet\/Clearance/Shoes]]></map>
        <map name="9714"><![CDATA[Outlet/Women's Outlet\/Clearance/Bags & Purses]]></map>
        <map name="1929"><![CDATA[Outlet/Women's Outlet\/Clearance/Accessories]]></map>
        <map name="1930"><![CDATA[Outlet/Women's Outlet\/Clearance/Jewellery & Watches]]></map>
        <map name="1940"><![CDATA[Outlet/Women's Outlet\/Clearance/Lingerie & Nightwear]]></map>
        <map name="5263"><![CDATA[Outlet/Women's Outlet\/Clearance/Swimwear]]></map>
        <map name="5862"><![CDATA[Outlet/Women's Outlet\/Clearance/Sports & Loungewear]]></map>
        <map name="12309"><![CDATA[Outlet/Women's Outlet\/Clearance/Gift Ideas]]></map>
        <map name="12058"><![CDATA[Outlet/Women's Outlet\/Clearance/Ski Shop]]></map>
        <map name="11627"><![CDATA[Outlet/Women's Outlet\/Clearance/Steal of the Week]]></map>

        <map name="8410"><![CDATA[Outlet/Men's Outlet\/Clearance/New In]]></map>
        <map name="5232"><![CDATA[Outlet/Men's Outlet\/Clearance/T-Shirts & Vests]]></map>
        <map name="3136"><![CDATA[Outlet/Men's Outlet\/Clearance/Shirts]]></map>
        <map name="5229"><![CDATA[Outlet/Men's Outlet\/Clearance/Polo Shirts]]></map>
        <map name="3137"><![CDATA[Outlet/Men's Outlet\/Clearance/Jumpers & Cardigans]]></map>
        <map name="2112"><![CDATA[Outlet/Men's Outlet\/Clearance/Jackets & Coats]]></map>
        <map name="12418"><![CDATA[Outlet/Men's Outlet\/Clearance/Hoodies & Sweatshirts]]></map>
        <map name="5230"><![CDATA[Outlet/Men's Outlet\/Clearance/Jeans]]></map>
        <map name="5231"><![CDATA[Outlet/Men's Outlet\/Clearance/Shorts]]></map>
        <map name="12421"><![CDATA[Outlet/Men's Outlet\/Clearance/Trousers]]></map>
        <map name="8134"><![CDATA[Outlet/Men's Outlet\/Clearance/Suits & Tailoring]]></map>
        <map name="1935"><![CDATA[Outlet/Men's Outlet\/Clearance/Shoes]]></map>
        <map name="2097"><![CDATA[Outlet/Men's Outlet\/Clearance/Accessories]]></map>
        <map name="8207"><![CDATA[Outlet/Men's Outlet\/Clearance/Sunglasses]]></map>
        <map name="8199"><![CDATA[Outlet/Men's Outlet\/Clearance/Jewellery & Watches]]></map>
        <map name="3764"><![CDATA[Outlet/Men's Outlet\/Clearance/Underwear & Socks]]></map>
        <map name="11413"><![CDATA[Outlet/Men's Outlet\/Clearance/Loungewear]]></map>
        <map name="11650"><![CDATA[Outlet/Men's Outlet\/Clearance/Gift Ideas]]></map>
        <map name="12064"><![CDATA[Outlet/Men's Outlet\/Clearance/Ski Shop]]></map>
        <map name="11642"><![CDATA[Outlet/Men's Outlet\/Clearance/Steal of the Week]]></map>


        <map name="9889"><![CDATA[Kids/Girls/New In]]></map>
        <map name="8518"><![CDATA[Kids/Girls/Little ASOS Collection]]></map>
        <map name="9898"><![CDATA[Kids/Girls/SALE]]></map>
        <map name="7466"><![CDATA[Kids/Girls/Dresses & Skirts]]></map>
        <map name="9891"><![CDATA[Kids/Girls/Tops & Tees]]></map>
        <map name="11703"><![CDATA[Kids/Girls/Jumpers & Cardigans]]></map>
        <map name="9892"><![CDATA[Kids/Girls/Jeans & Trousers]]></map>
        <map name="10501"><![CDATA[Kids/Girls/Shorts]]></map>
        <map name="9893"><![CDATA[Kids/Girls/Jackets & Coats]]></map>
        <map name="9894"><![CDATA[Kids/Girls/Bodysuits & Nightwear]]></map>
        <map name="9895"><![CDATA[Kids/Girls/Swimwear]]></map>
        <map name="9896"><![CDATA[Kids/Girls/Accessories]]></map>
        <map name="9890"><![CDATA[Kids/Girls/Shoes]]></map>


        <map name="7464"><![CDATA[Kids/Boys/New In]]></map>
        <map name="8518"><![CDATA[Kids/Boys/Little ASOS Collection]]></map>
        <map name="8022"><![CDATA[Kids/Boys/SALE]]></map>
        <map name="7471"><![CDATA[Kids/Boys/Shoes]]></map>
        <map name="8319"><![CDATA[Kids/Boys/Tops & Tees]]></map>
        <map name="11704"><![CDATA[Kids/Boys/Jumpers & Cardigans]]></map>
        <map name="7467"><![CDATA[Kids/Boys/Jeans & Trousers]]></map>
        <map name="10502"><![CDATA[Kids/Boys/Shorts]]></map>
        <map name="7469"><![CDATA[Kids/Boys/Jackets & Coats]]></map>
        <map name="7468"><![CDATA[Kids/Boys/Bodysuits & Nightwear]]></map>
        <map name="9766"><![CDATA[Kids/Boys/Swimwear]]></map>
        <map name="7472"><![CDATA[Kids/Boys/Accessories]]></map>

    </var>
</action>


<action type="asos_dataflow/convert_mapper_transformer" method="map">
    <var name="df-direction">import</var>
</action>


<action type="df_dataflow/convert_mapper_defaults" method="map">
    <var name="df-direction">import</var>
    <var name="map">
        <map name="store"><![CDATA[default]]></map>
        <map name="websites"><![CDATA[base]]></map>
        <map name="type"><![CDATA[simple]]></map>
        <map name="attribute_set"><![CDATA[shop-eho]]></map>
        <map name="tax_class_id"><![CDATA[None]]></map>
        <map name="status"><![CDATA[Enabled]]></map>
        <map name="weight"><![CDATA[1]]></map>
        <map name="visibility"><![CDATA[Catalog, Search]]></map>
        <map name="use_config_manage_stock"><![CDATA[1]]></map>
    </var>
</action>


#2 Зафар
  • Группа: Пользователь
  • Сообщений: 7
  • Регистрация: 26.09.2011

26.09.2011 18:44

было бы здорово еще увидеть использованные модели.
df_dataflow/convert_mapper_column
asos_dataflow/convert_mapper_category
asos_dataflow/convert_mapper_transformer
df_dataflow/convert_mapper_defaults

Могу я вас попросить выложить их для образовательных целей?

#3 Дмитрий Федюк
  • Администратор
  • Иконка
  • Группа: Администратор
  • Сообщений: 8995
  • Регистрация: 20.02.2010

03.10.2011 20:06

Тут всё просто: закажите проект по автоматизации импорта - и в результате получите готовое рабочее решение, которое в дальнейшем можно будет использовать для обучения.

Поделиться темой: