Skip to content

Commit e6844a5

Browse files
committed
PIM training: About data migration
1 parent a2537b3 commit e6844a5

File tree

3 files changed

+54
-13
lines changed

3 files changed

+54
-13
lines changed

docs/trainings/commerce/pim/000_syllabus.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ page_type: training
77

88
## Syllabus
99

10-
In this training, you learn how to create complex products, to quote their prices, and to organize them in catalogs, using the build-in features.
10+
In this training, you learn how to create complex products, and to sort them.
1111

12-
| Section | Estimated | Description |
13-
|:--------------------------------------------|----------:|:----------------------------------------------------------|
14-
| [Product modeling](011_product_modeling.md) | X minutes | Learn about product types, products and product variants. |
15-
| [Product shelving](012_product_shelving.md) | Y minutes | Organize your products with categories and catalogs. |
12+
| Section | Estimated | Description |
13+
|:--------------------------------------------|----------:|:------------------------------------------------------------|
14+
| [Product modeling](011_product_modeling.md) | X minutes | Learn about product types, products and product variants. |
15+
| [Product shelving](012_product_shelving.md) | Y minutes | Organize your products with categories and catalogs. |
16+
| [Product migration](021_migration.md) | Z minutes | Export your product model for deployment on other installs. |
1617

1718
## Requirements
1819

@@ -31,9 +32,7 @@ In this training, you learn how to create complex products, to quote their price
3132
- [[= product_name_exp =]] [[= latest_tag_4_6 =]]
3233
- [[= product_name_com =]] [[= latest_tag_4_6 =]]
3334

34-
TODO: Make sure that everything used is in Ibexa DXP Headless scope, so to speak, ibexa/product-catalog
35-
36-
TODO: Trainees working on Ibexa DXP Commerce could pick examples from ibexa/storefront but others mustn't be frustrated of having installed an inferior edition.
35+
TODO: Make sure that everything used is in Ibexa DXP Headless scope, so to speak, ibexa/product-catalog. It mustn't use features from ibexa/storefront.
3736

3837
### Cluster elements
3938

@@ -47,6 +46,6 @@ This training can be run on the minimal stack.
4746

4847
### Starting state
4948

50-
To follow this training, you must install code, config and data on top of a fresh installation.
49+
To follow this training, you must install code, configuration, and data on top of a fresh installation.
5150

5251
TODO: Experience clean install, or previous bike ride design and content?

docs/trainings/commerce/pim/011_product_modeling.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ page_type: training
99
## Product types
1010

1111
The product type base concept is close to the content type one.
12-
Like a content type structures a family content items, a product type structures products.
12+
Like a content type structures a family of content items, a product type structures products.
1313

1414
See a first conceptualisation of what a product is, and what a product type is, in [Documentation > PIM (Product management) > Products](products.md).
1515

@@ -40,8 +40,10 @@ SELECT cg.group_id, cg.group_name, g.is_system, c.id, c.identifier, c.version
4040
The "Product specification" field type (`ibexa_product_specification`) brings in the power of attributes.
4141

4242
Notice that you don't need to add a field or an attribute for price.
43-
Prices are handled by a particular side mechanism, the price engine, which is treated later in the training with VAT, currencies, etc.
43+
Prices are handled by a particular side mechanism, the price engine, which is not treated in this training.
4444
But, also notice that VAT is set at product type level.
45+
The associations of VAT categories to regions are also stored by the `ibexa_product_specification` field.
46+
TODO: This is demonstrated in migration.
4547

4648
## Attributes VS Fields
4749

@@ -55,8 +57,6 @@ Only the display of those properties changes with the language. See the followin
5557
- The color of a product is the same whatever the language is, only the corresponding color name is translated.
5658
- The radius of a sphere doesn't depend on the language, only its numeral representation need translation according to local length units.
5759

58-
TODO: Later in the training, in the templating part, is shown how to localize the attributes.
59-
6060
Unlike fields, attributes are first defined outside the product types.
6161
Attributes and attribute groups are to be reused from product type to product type.
6262

@@ -237,6 +237,7 @@ But, if you're curious, you can read or implements as a bonus the following cust
237237
??? note "TODO: Possible solution(s)"
238238

239239
TODO: Propose grouped attributes and product type(s), illustrate their usage with few products and product variants.
240+
TODO: Materials as 1 attribute. Paintjobs as 2 attributes, one per series to reduce selection list length? 3 attributes groups, one common, one per series? Then 2 product types, one per series?
240241

241242
Your new products are in the "Uncategorized products" section of the **Products** admin page.
242243
It's now time to fix this in the next chapter.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
description: "PIM training: Migration"
3+
edition: experience
4+
page_type: training
5+
---
6+
7+
# Product model migration
8+
9+
After having modeled your catalog organization on your local developer instance,
10+
you may want/need to [generate migration files](exporting_data.md) to install the model on a shared instance
11+
(for example a staging instance or the production instance) where the creation of the products will be done.
12+
13+
Export attribute groups, attributes, and product types:
14+
15+
``` bash
16+
php bin/console ibexa:migrations:generate \
17+
--type=attribute_group --mode=create \
18+
--match-property=identifier --value=bike --value=mtb-s4 --value=mtb-s5 \
19+
--siteaccess=admin;
20+
21+
# Where 2, 3, and 4 are the IDs of the attribute groups bike, mtb-s4, and mtb-s5
22+
php bin/console ibexa:migrations:generate \
23+
--type=attribute --mode=create \
24+
--match-property=attribute_group_id --value=2 --value=3 --value=4 \
25+
--siteaccess=admin;
26+
27+
php bin/console ibexa:migrations:generate \
28+
--type=content_type --mode=create \
29+
--match-property=content_type_identifier --value=mtb-s4 --value=mtb-s5 \
30+
--siteaccess=admin;
31+
```
32+
33+
Export product categories:
34+
35+
``` bash
36+
# Where 63 is the "Product Root Tag" Location ID (Product catalog > Categories)
37+
php bin/console ibexa:migrations:generate \
38+
--type=content --mode=create \
39+
--match-property=parent_location_id --value=63 \
40+
--siteaccess=admin;
41+
```

0 commit comments

Comments
 (0)