You are here

shopify_product_variation_type.yml in Commerce Migrate 3.1.x

modules/shopify/migrations/shopify_product_variation_type.yml

File

modules/shopify/migrations/shopify_product_variation_type.yml
View source
  1. id: shopify_product_variation_type
  2. label: Shopify product variation type
  3. migration_group: commerce_migrate_shopify
  4. migration_tags:
  5. - Shopify
  6. - Configuration
  7. source:
  8. plugin: csv
  9. # Change the path and filename to match your source CSV file.
  10. path: 'public://import/shopify-products_export_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. # Since this is keyed by 'handle', which can contains duplicates, the number
  16. # of rows in the file will probably be greater than the number of row
  17. # processed. Set skip_count true so that count check is not used when
  18. # determining if the migration succeeded. This means this migration can be
  19. # used as a dependency.
  20. skip_count: true
  21. # The key used here is used in the product variation migration and must be
  22. # available on every row. The 'type' column is not used because it can be
  23. # empty. Instead use the 'handle' column which is a machine name of this
  24. # product and exists on every row.
  25. ids: [handle]
  26. fields:
  27. - name: handle
  28. label: Handle
  29. - name: title
  30. label: Title
  31. - name: body
  32. label: Body (HTML)
  33. - name: vendor
  34. label: Vendor
  35. - name: type
  36. label: Type
  37. constants:
  38. variation_type: default
  39. line_item_type: product_variations
  40. # Do not generate a title.
  41. generate_title: false
  42. process:
  43. exists:
  44. -
  45. plugin: entity_exists
  46. source: type
  47. entity_type: commerce_product_variation_type
  48. -
  49. plugin: callback
  50. callable: is_bool
  51. -
  52. plugin: skip_on_empty
  53. method: row
  54. id:
  55. -
  56. plugin: skip_on_empty
  57. method: row
  58. source: type
  59. -
  60. plugin: machine_name
  61. revision: revision
  62. label:
  63. plugin: callback
  64. callable: ucfirst
  65. source: type
  66. description:
  67. plugin: callback
  68. callable: ucfirst
  69. source: type
  70. generateTitle: 'constants/generate_title'
  71. lineItemType: 'constants/line_item_type'
  72. orderItemType:
  73. plugin: default_value
  74. source: line_item_type
  75. default_value: default
  76. destination:
  77. plugin: 'entity:commerce_product_variation_type'
  78. destination_module: commerce_product