You are here

shopify_taxonomy_term.yml in Commerce Migrate 3.1.x

modules/shopify/migrations/shopify_taxonomy_term.yml

File

modules/shopify/migrations/shopify_taxonomy_term.yml
View source
  1. # This migration uses a source CSV file created using the Shopify product
  2. # export.
  3. id: shopify_taxonomy_term
  4. label: Migrate Shopify category to taxonomy terms.
  5. migration_group: commerce_migrate_shopify
  6. migration_tags:
  7. - Shopify
  8. - Content
  9. source:
  10. # Uses a custom source plugin that handles a single column of the source CSV
  11. # where each value is a comma separated list of items.
  12. plugin: commerce_migrate_csvcell
  13. # Change the path and filename to match your source CSV file.
  14. path: 'public://import/shopify-products_export_test.csv'
  15. # Change the enclosure character to suit your source CVS file.
  16. enclosure: "\""
  17. # Change the number of header rows to suit your source CVS file.
  18. header_offset: 0
  19. # The key field for this migration.
  20. ids: [name]
  21. constants:
  22. vocabulary: tags
  23. process:
  24. vid: constants/vocabulary
  25. # Skip this row if name is empty or term already exists for this term.
  26. exists:
  27. -
  28. plugin: skip_on_empty
  29. source: name
  30. method: row
  31. -
  32. plugin: entity_lookup
  33. value_key: name
  34. bundle_key: vid
  35. bundle: tags
  36. entity_type: taxonomy_term
  37. -
  38. plugin: callback
  39. callable: is_null
  40. -
  41. plugin: skip_on_empty
  42. method: row
  43. name: name
  44. parent:
  45. plugin: default_value
  46. default_value: 0
  47. weight:
  48. plugin: default_value
  49. default_value: 0
  50. destination:
  51. plugin: entity:taxonomy_term