You are here

csv_example_attribute_value.yml in Commerce Migrate 3.1.x

modules/csv_example/migrations/csv_example_attribute_value.yml

File

modules/csv_example/migrations/csv_example_attribute_value.yml
View source
  1. # Import attribute values for existing attributes.
  2. #
  3. # Attributes are imported in name/value pairs. Up to 4 pairs per row can be
  4. # imported with this migrations. The text in the name column is expected to the
  5. # be the same for that entire column. The value should be whatever is required
  6. # for the product variation in that row.
  7. #
  8. # Destination site configuration:
  9. # - Install the Commerce Module.
  10. # - Create the attributes, with only one value, on the destination site.
  11. #
  12. id: csv_example_attribute_value
  13. label: Product attribute values
  14. migration_group: commerce_migrate_csv_example
  15. migration_tags:
  16. - Commerce CSV
  17. - Content
  18. source:
  19. plugin: csv_example_attribute
  20. path: 'public://import/example-products.csv'
  21. enclosure: "\""
  22. header_offset: 0
  23. ids: [attribute_name, attribute_value]
  24. fields:
  25. - name: title
  26. label: Title
  27. - name: sku
  28. label: SKU
  29. - name: status
  30. label: Status
  31. - name: product_type
  32. label: Product type
  33. - name: description
  34. label: Description
  35. - name: product_variation_type
  36. label: Product variation type
  37. - name: sell_price
  38. label: Sell price
  39. - name: vocabulary_name1
  40. label: Vocabulary1
  41. - name: term1
  42. label: Vocabulary value1
  43. - name: vocabulary_name2
  44. label: Vocabulary2
  45. - name: term2
  46. label: Vocabulary value2
  47. - name: vocabulary_name3
  48. label: Vocabulary3
  49. - name: term3
  50. label: Vocabulary value3
  51. - name: attribute_name1
  52. label: Attribute name1
  53. - name: attribute_value1
  54. label: Attribute value1
  55. - name: attribute_name2
  56. label: Attribute name2
  57. - name: attribute_value2
  58. label: Attribute value2
  59. - name: attribute_name3
  60. label: Attribute name3
  61. - name: attribute_value3
  62. label: Attribute value3
  63. - name: attribute_name4
  64. label: Attribute name4
  65. - name: attribute_value4
  66. label: Attribute value4
  67. constants:
  68. langcode: en
  69. process:
  70. langcode: 'constants/langcode'
  71. # Convert the attribute name to a machine name.
  72. attribute:
  73. -
  74. plugin: machine_name
  75. source: attribute_name
  76. name: attribute_value
  77. destination:
  78. plugin: entity:commerce_product_attribute_value
  79. destination_module: commerce_product