You are here

woo3_categories_term.yml in Commerce Migrate 8.2

modules/woocommerce/migrations/woo3_categories_term.yml

File

modules/woocommerce/migrations/woo3_categories_term.yml
View source
  1. # This migration uses a source CSV file created using the WooCommerce product
  2. # export.
  3. id: woo3_categories_term
  4. label: Migrate WooCommerce 3 category to taxonomy terms.
  5. migration_group: commerce_migrate_woo3
  6. migration_tags:
  7. - WooCommerce 3
  8. - Content
  9. source:
  10. # Uses a custom source plugin, based on the CSV source plugin in
  11. # migrate_source_csv, that will build an array of product variation ids as
  12. # well as trim the input from the source CSV.
  13. plugin: woo3_categories_term_csv
  14. # Change the path and filename to match your source CSV file.
  15. path: 'public://import/woo3-product-export-7-5-2018-1525686755964.csv'
  16. # Change the enclosure character to suit your source CVS file.
  17. enclosure: "\""
  18. # Change the number of header rows to suit your source CVS file.
  19. header_offset: 0
  20. # The key field for this migration. List many column names as needed to create
  21. # a unique key for your migration. These keys are also used when a
  22. # migration_lookup process is needed with this migration.
  23. ids: [name]
  24. constants:
  25. vocabulary: categories
  26. process:
  27. vid: constants/vocabulary
  28. name:
  29. -
  30. plugin: static_map
  31. source: name
  32. bypass: true
  33. map:
  34. Uncategorized: false
  35. -
  36. plugin: skip_on_empty
  37. method: row
  38. parent_id:
  39. -
  40. plugin: skip_on_empty
  41. method: process
  42. source: parent
  43. -
  44. plugin: migration_lookup
  45. migration: woo3_categories_term
  46. source:
  47. - parent
  48. parent:
  49. plugin: default_value
  50. default_value: 0
  51. source: '@parent_id'
  52. weight:
  53. plugin: default_value
  54. default_value: 0
  55. destination:
  56. plugin: entity:taxonomy_term