You are here

magento2_product_variation.yml in Commerce Migrate 3.1.x

modules/magento/migrations/magento2_product_variation.yml

File

modules/magento/migrations/magento2_product_variation.yml
View source
  1. id: magento2_product_variation
  2. label: Product variations
  3. migration_group: commerce_migrate_magento2
  4. migration_tags:
  5. - Magento 2
  6. - Content
  7. source:
  8. plugin: csv
  9. # Change the path and filename to match your source CSV file.
  10. path: 'public://import/magento2-catalog_product_20180326_013553_test.csv'
  11. # Change the enclosure character to suit your source CVS file.
  12. enclosure: "\""
  13. # Change the number of header rows to suit your source CVS file.
  14. header_offset: 0
  15. # The key fields attribute and name are set in the row in the source plugin.
  16. ids: [sku]
  17. process:
  18. sku: sku
  19. title: name
  20. uid:
  21. plugin: default_value
  22. default_value: 1
  23. # The currency code default is 'USD'. If your are using a different currency
  24. # change the default value here.
  25. currency_code:
  26. plugin: default_value
  27. default_value: USD
  28. price:
  29. plugin: magento2_commerce_price
  30. source:
  31. - price
  32. - '@currency_code'
  33. # The product variation type defaults to 'default'. For each product variation
  34. # type, make a new migration and change the default value to the desired
  35. # machine name.
  36. type:
  37. -
  38. plugin: migration_lookup
  39. migration: magento2_product_variation_type
  40. source: attribute_set_code
  41. -
  42. plugin: default_value
  43. default_value: default
  44. active: product_online
  45. # Attributes are single valued entity reference fields migrated in name/id
  46. # pairs. The attribute name must be a machine name of a certain format.
  47. created:
  48. -
  49. plugin: explode
  50. delimiter: ','
  51. source: created_at
  52. -
  53. plugin: concat
  54. -
  55. plugin: format_date
  56. from_format: 'n/d/y g:i A'
  57. to_format: U
  58. changed:
  59. -
  60. plugin: explode
  61. delimiter: ','
  62. source: updated_at
  63. -
  64. plugin: concat
  65. -
  66. plugin: format_date
  67. from_format: 'n/d/y g:i A'
  68. to_format: U
  69. destination:
  70. plugin: 'entity:commerce_product_variation'
  71. migration_dependencies:
  72. required:
  73. - magento2_product_variation_type