You are here

commerce1_order.yml in Commerce Migrate 3.1.x

modules/commerce/migrations/commerce1_order.yml

File

modules/commerce/migrations/commerce1_order.yml
View source
  1. id: commerce1_order
  2. label: Commerce order
  3. migration_tags:
  4. - Drupal 7
  5. - Commerce
  6. - Content
  7. class: Drupal\commerce_migrate_commerce\Plugin\migrate\Order
  8. source:
  9. plugin: commerce1_order
  10. process:
  11. # If you are using this file to build a custom migration consider removing
  12. # the order_id field to allow incremental migrations.
  13. order_id: order_id
  14. order_number: order_number
  15. revision_id: revision_id
  16. type:
  17. plugin: static_map
  18. source: type
  19. default_value: default
  20. map:
  21. commerce_order: default
  22. uid: uid
  23. ip_address: hostname
  24. state:
  25. plugin: static_map
  26. source: status
  27. map:
  28. checkout_checkout: draft
  29. checkout_review: draft
  30. checkout_payment: draft
  31. checkout_complete: draft
  32. cart: draft
  33. canceled: canceled
  34. # If you are using validation change 'completed' to 'validation' for the
  35. # pending and processing states.
  36. pending: completed
  37. processing: completed
  38. completed: completed
  39. cart:
  40. plugin: static_map
  41. source: status
  42. default_value: false
  43. map:
  44. cart: true
  45. created: created
  46. changed: changed
  47. # Set the placed time only if not draft or cancelled.
  48. placed:
  49. -
  50. plugin: skip_on_value
  51. method: process
  52. source: '@state'
  53. value:
  54. - draft
  55. - cancelled
  56. -
  57. plugin: get
  58. source: created
  59. # Set the completed time only if completed
  60. completed:
  61. -
  62. plugin: skip_on_value
  63. method: process
  64. not_equals: true
  65. source: '@state'
  66. value: completed
  67. -
  68. plugin: get
  69. source: changed
  70. mail: mail
  71. # Do not refresh the order during migration.
  72. data/refresh_state: refresh_state
  73. store_id:
  74. plugin: default_value
  75. source: default_store_id
  76. default_value: 1
  77. adjustments:
  78. -
  79. plugin: commerce1_order_adjustment_shipping
  80. source: shipping_line_items
  81. -
  82. plugin: commerce_adjustments
  83. destination:
  84. plugin: 'entity:commerce_order'
  85. destination_module: commerce_order
  86. migration_dependencies:
  87. required:
  88. - commerce1_order_item
  89. - commerce1_profile
  90. optional:
  91. - d7_field_instance