You are here

magento2_product_attribute.yml in Commerce Migrate 3.1.x

modules/magento/migrations/magento2_product_attribute.yml

File

modules/magento/migrations/magento2_product_attribute.yml
View source
  1. id: magento2_product_attribute
  2. label: Magento 2product attribute
  3. migration_group: commerce_migrate_magento2
  4. migration_tags:
  5. - Magento 2
  6. - Configuration
  7. source:
  8. # Uses a custom source plugin to yield the attributes.
  9. plugin: magento2_product_attribute_csv
  10. # Change the path and filename to match your source CSV file.
  11. path: 'public://import/magento2-catalog_product_20180326_013553.csv'
  12. # Change the enclosure character to suit your source CVS file.
  13. enclosure: "\""
  14. # Change the number of header rows to suit your source CVS file.
  15. header_offset: 0
  16. # The key fields attribute is set in the row in the source plugin.
  17. ids: [attribute]
  18. fields:
  19. - name: sku
  20. label: SKU
  21. - name: store_view_code
  22. label: Store view code
  23. - name: attribute_set_code
  24. label: Attribute set code
  25. - name: product_type
  26. label: Product type
  27. - name: categories
  28. label: Categories
  29. - name: product_websites
  30. label: Product websites
  31. - name: name
  32. label: Name
  33. - name: description
  34. label: Description
  35. - name: short_description
  36. label: Short description
  37. - name: weight
  38. label: Weight
  39. - name: product_online
  40. label: product_online
  41. - name: tax_class_name
  42. label: tax_class_name
  43. - name: visibility
  44. label: visibility
  45. - name: price
  46. label: Price
  47. - name: special_price
  48. label: Special price
  49. - name: special_price_from_date
  50. label: Special price from date
  51. - name: special_price_to_date
  52. label: Special price to date
  53. - name: url_key
  54. label: Url key
  55. - name: meta_title
  56. label: Meta title
  57. - name: meta_keywords
  58. label: Meta keywords
  59. - name: meta_description
  60. label: Meta description
  61. - name: base_image
  62. label: Base image
  63. - name: base_image_label
  64. label: Base image label
  65. - name: small_image
  66. label: Small image
  67. - name: small_image_label
  68. label: Small image label
  69. - name: thumbnail_image
  70. label: Thumbnail image
  71. - name: thumbnail_image_label
  72. label: Thumbnail image label
  73. - name: swatch_image
  74. label: Swatch image
  75. - name: swatch_image_label
  76. label: Swatch image label
  77. - name: created_at
  78. label: Created at
  79. - name: updated_at
  80. label: Updated at
  81. - name: new_from_date
  82. label: New from date
  83. - name: new_to_date
  84. label: New to date
  85. - name: display_product_options_in
  86. label: display product options in
  87. - name: map_price
  88. label: Map price
  89. - name: msrp_price
  90. label: MSRP price
  91. - name: msrp_price
  92. label: msrp_price
  93. - name: map_enabled
  94. label: map_enabled
  95. - name: gift_message_available
  96. label: gift_message_available
  97. - name: custom_design
  98. label: custom_design
  99. - name: custom_design_from
  100. label: custom_design_from
  101. - name: custom_design_to
  102. label: custom_design_to
  103. - name: custom_layout_update
  104. label: custom_layout_update
  105. - name: page_layout
  106. label: page_layout
  107. - name: product_options_container
  108. label: product_options_container
  109. - name: msrp_display_actual_price_type
  110. label: msrp_display_actual_price_type
  111. - name: country_of_manufacture
  112. label: country_of_manufacture
  113. - name: additional_attributes
  114. label: additional_attributes
  115. process:
  116. # Commerce prefixes the id with 'attribute_' so truncate the attribute to 22
  117. # characters to keep within the 32 character limit. If this needs to be made
  118. # unique that number, 22, must be reduced to allow for the extra characters
  119. # added by make_unique_entity_field. Reduce by 2 if not using a postfix
  120. # character or 3 if your migration uses the postfix configuration option.
  121. id:
  122. -
  123. plugin: machine_name
  124. source: attribute
  125. -
  126. plugin: skip_on_empty
  127. method: row
  128. -
  129. plugin: substr
  130. length: 22
  131. # Convert the attribute to a more human readable form. Change the underscores
  132. # to spaces and capitalize the first character.
  133. label:
  134. -
  135. plugin: skip_on_empty
  136. method: row
  137. source: attribute
  138. -
  139. plugin: explode
  140. delimiter: _
  141. -
  142. plugin: concat
  143. delimiter: ' '
  144. -
  145. plugin: callback
  146. callable: ucfirst
  147. # The element type can be 'text', 'select', 'radios', or 'checkbox'.
  148. elementType:
  149. plugin: default_value
  150. default_value: select
  151. destination:
  152. plugin: entity:commerce_product_attribute
  153. destination_module: commerce_product