@@ -65,8 +65,10 @@ The following data migration step modes are available:
6565| `object_state` | ✔ | | |
6666| `object_state_group` | ✔ | | |
6767| `payment_method` | ✔ | | |
68+ | `product_asset` | ✔ | | |
6869| `product_availability` | ✔ | | |
6970| `product_price` | ✔ | | |
71+ | `product_variant` | ✔ | | |
7072| `role` | ✔ | ✔ | ✔ |
7173| `section` | ✔ | ✔ | |
7274| `segment` | ✔ | ✔ | ✔ |
@@ -250,7 +252,7 @@ Adjust the migration file and configure the `image` field data as follows:
250252 path: src/Migrations/images/example-image.png
251253` ` `
252254
253- This migration copies the image to the appropriate directory,
255+ This migration copies the image to the appropriate directory,
254256in this case `public/var/site/storage/images/3/8/3/0/254-1-eng-GB/example-image.png`,
255257enabling swift file migration regardless of storage (local, DFS).
256258
@@ -267,7 +269,7 @@ The following example shows the creation of a `Contributor` Role:
267269[[= include_file('code_samples/data_migration/examples/create_role.yaml') =]]
268270` ` `
269271
270- To update an existing Role, 2 policies' modes are available :
272+ To update an existing Role, two policies' modes are available :
271273
272274- `replace` : (default) All existing policies are replaced by the ones from the migration.
273275- `append` : Migration policies are added while already existing ones are kept.
@@ -303,7 +305,7 @@ You can use an [action](data_migration_actions.md) to assign a Role to the user.
303305[[= include_file('code_samples/data_migration/examples/create_user.yaml') =]]
304306` ` `
305307
306- # ## Language
308+ # ## Languages
307309
308310The following example shows how to create a language.
309311
@@ -315,6 +317,8 @@ The required metadata keys are: `languageCode`, `name`, and `enabled`.
315317
316318# ## Product catalog
317319
320+ # ### Attributes and attribute groups
321+
318322The following example shows how to create an attribute group with two attributes :
319323
320324` ` ` yaml
@@ -329,7 +333,7 @@ You can also update attributes, including changing which attribute group they be
329333
330334You can't change the attribute type of an existing attribute.
331335
332- # ### Product type
336+ # ### Product types
333337
334338The following example shows how to create a product type.
335339
@@ -342,38 +346,70 @@ A product type must also contain the definition for an `ibexa_product_specificat
342346[[= include_file('code_samples/data_migration/examples/create_product_type.yaml') =]]
343347` ` `
344348
345- # ### Customer groups
349+ # ### Products
346350
347- The following example shows how to create a customer group with a defined global price discount :
351+ The following example shows how to create a product :
348352
349353` ` ` yaml
350- [[= include_file('code_samples/data_migration/examples/create_customer_group .yaml') =]]
354+ [[= include_file('code_samples/data_migration/examples/create_product_variant .yaml', 1, 18 ) =]]
351355` ` `
352356
353- # ### Currencies
357+ # ### Product variants
354358
355- The following example shows how to create a currency :
359+ The following example shows how to create variants for a product identified by its code :
356360
357361` ` ` yaml
358- [[= include_file('code_samples/data_migration/examples/create_currency.yaml') =]]
362+ [[= include_file('code_samples/data_migration/examples/create_product_variant.yaml', 20, 29) =]]
363+ ` ` `
364+
365+ # ### Product assets
366+
367+ The following example creates an image [Content item](#content-items) from a local image file, and then uses it as a product asset for a variant ([created in previous example](#product-variant)):
368+
369+ ` ` ` yaml
370+ [[= include_file('code_samples/data_migration/examples/create_product_asset.yaml') =]]
359371` ` `
360372
361- # ### Prices
373+ This migration uses a [reference](managing_migrations.md#references) to store the created image Content ID, and then uses it while creating the asset.
374+ It uses an [expression syntax](#expression-syntax) to [concat (`~`)]([[= symfony_doc =]]/reference/formats/expression_language.html#string-operators)
375+ the mandatory scheme `ezcontent://` and the image content ID through the [`reference` function](#built-in-functions) used on the reference's name.
376+
377+ # ### Product prices
362378
363379The following example shows how to create a price for a product identified by its code :
364380
365381` ` ` yaml
366- [[= include_file('code_samples/data_migration/examples/create_price.yaml') =]]
382+ [[= include_file('code_samples/data_migration/examples/create_product_price.yaml') =]]
383+ ` ` `
384+
385+ # ### Customer groups
386+
387+ The following example shows how to create a customer group with a defined global price discount :
388+
389+ ` ` ` yaml
390+ [[= include_file('code_samples/data_migration/examples/create_customer_group.yaml') =]]
391+ ` ` `
392+
393+ # ### Currencies
394+
395+ The following example shows how to create a currency :
396+
397+ ` ` ` yaml
398+ [[= include_file('code_samples/data_migration/examples/create_currency.yaml') =]]
367399` ` `
368400
369401# ## Commerce [[% include 'snippets/commerce_badge.md' %]]
370402
403+ # ### Payment methods
404+
371405The following example shows how to create a payment method :
372406
373407` ` ` yaml
374408[[= include_file('code_samples/data_migration/examples/create_payment_method.yaml') =]]
375409` ` `
376410
411+ # ### Shipping methods
412+
377413The following example shows how to create a shipping method :
378414
379415` ` ` yaml
0 commit comments