You are here

shopify_product_variation.yml in Commerce Migrate 3.1.x

modules/shopify/migrations/shopify_product_variation.yml

File

modules/shopify/migrations/shopify_product_variation.yml
View source
  1. id: shopify_product_variation
  2. label: Shopify product variation
  3. migration_group: commerce_migrate_shopify
  4. migration_tags:
  5. - Shopify
  6. - Content
  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. # The key fields attribute and name are set in the row in the source plugin.
  16. ids: [variant_sku]
  17. fields:
  18. - name: handle
  19. label: Handle
  20. - name: title
  21. label: Title
  22. - name: body
  23. label: Body (HTML)
  24. - name: vendor
  25. label: Vendor
  26. - name: type
  27. label: Type
  28. - name: tags
  29. label: Tags
  30. - name: published
  31. label: Published
  32. - name: option1_name
  33. label: Option1 Name
  34. - name: optiona1_value
  35. label: Option1 Value
  36. - name: option2_name
  37. label: Option2 Name
  38. - name: option2_value
  39. label: Option2 Value
  40. - name: option3_name
  41. label: Option3 Name
  42. - name: option3_value
  43. label: Option3 Value
  44. - name: variant_sku
  45. label: Variant SKU
  46. - name: variant_grams
  47. label: Variant Grams
  48. - name: variant_inventoty_tracked
  49. label: Variant Inventory Tracker
  50. - name: variant_inventory_qty
  51. label: Variant Inventory Qty
  52. - name: variant_inventory_policy
  53. label: Variant Inventory Policy
  54. - name: variant_fulfillment_service
  55. label: Variant Fulfillment Service
  56. - name: variant_price
  57. label: Variant Price
  58. process:
  59. sku: variant_sku
  60. uid:
  61. plugin: default_value
  62. default_value: 1
  63. # The currency code default is 'USD'. If your are using a different currency
  64. # change the default value here.
  65. currency_code:
  66. plugin: default_value
  67. default_value: USD
  68. price:
  69. plugin: shopify_commerce_price
  70. source:
  71. - variant_price
  72. - '@currency_code'
  73. # The 'handle' column is the key for the product variation type migration.
  74. type:
  75. -
  76. plugin: migration_lookup
  77. migration: shopify_product_variation_type
  78. source: handle
  79. -
  80. plugin: default_value
  81. default_value: default
  82. active: published
  83. destination:
  84. plugin: 'entity:commerce_product_variation'
  85. migration_dependencies:
  86. required:
  87. - shopify_product_variation_type