Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8198: PIM training #2449

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
09a719f
[WIP] PIM training raw draft
adriendupuis Jul 31, 2024
e649798
[WIP] PIM training raw draft
adriendupuis Jul 31, 2024
60e5294
[WIP] PIM training raw draft
adriendupuis Jul 31, 2024
b46decd
[WIP] PIM training raw draft
adriendupuis Jul 31, 2024
c8f2464
[WIP] PIM training raw draft
adriendupuis Jul 31, 2024
c898b99
[WIP] PIM training: rework syllabus
adriendupuis Jul 31, 2024
7ccac99
011_product_modeling.md: Fix list indent
adriendupuis Sep 13, 2024
b8c22b1
011_product_modeling.md: Continue bike modeling exercise
adriendupuis Oct 2, 2024
66cdec2
021_product_pricing.md: Few notes for the future
adriendupuis Oct 2, 2024
121f4b9
011_product_modeling.md: Add a code generator example
adriendupuis Oct 4, 2024
67db240
PHP CS Fixes
adriendupuis Oct 4, 2024
6717a13
PIM training: Narrow down to modeling and sorting products.
adriendupuis Oct 9, 2024
4a66c69
011_product_modeling.md: Fix some vale warnings
adriendupuis Oct 9, 2024
a8702c8
011_product_modeling.md: UK Aluminium → US Aluminum
adriendupuis Oct 9, 2024
a2537b3
000_syllabus.md: Fix Ibexa.SpacingNestedList
adriendupuis Oct 9, 2024
e6844a5
PIM training: About data migration
adriendupuis Oct 10, 2024
66f1408
011_product_modeling.md: few notes
adriendupuis Oct 11, 2024
64c0c12
011_product_modeling.md: few notes
adriendupuis Oct 11, 2024
462bb5d
PIM training: draft ideas for APIs
adriendupuis Oct 15, 2024
c1305c7
011_product_modeling.md: About assets
adriendupuis Oct 16, 2024
69ceb26
021_product_exchange.md: Reorganize TOC, continue PHP API
adriendupuis Oct 17, 2024
af9c1bb
021_product_exchange.md: Fix Contracts namespace name
adriendupuis Oct 17, 2024
c226798
021_product_exchange.md: minor change
adriendupuis Oct 17, 2024
ef42e4e
021_product_exchange.md: Start REST API ToC, sort routes
adriendupuis Oct 17, 2024
a3f4afd
021_product_exchange.md: Fix a link to PHP API Ref
adriendupuis Oct 18, 2024
cb5e0ff
Merge branch 'master' into IBX-8198-PIM-training
adriendupuis Oct 18, 2024
566f1b2
011_product_modeling.md: More about translation
adriendupuis Oct 18, 2024
196a557
composer.json minimum-stability dev
adriendupuis Oct 18, 2024
9224832
Revert "composer.json minimum-stability dev"
adriendupuis Oct 18, 2024
44d7369
011_product_modeling.md: Add Series column
adriendupuis Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/trainings/commerce/pim/000_syllabus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---

Check warning on line 1 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L1

[Ibexa.ReadingLevel] The grade level is 7.59. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 7.59. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: PIM training
---

# PIM (Product Information Management)

## Syllabus

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.

| Section | Estimated | Description |
|:------------------------------------------------|----------:|:------------------------------------------------------------------------------|
| [Product modeling](011_product_modeling.md) | X minutes | Learn about product types, products and product variants. |
| [Product shelving](012_product_shelving.md) | Y minutes | Organize your products with categories and catalogs. |
| [Product displaying](013_product_displaying.md) | Z minutes | Template the product page. |
| [Product pricing](021_product_pricing.md) | N minutes | Manage currencies and VAT rates, compute prices. (TODO: discount needs users) |

Check warning on line 16 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L16

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 16, "column": 144}}}, "severity": "WARNING"}

## Requirements

### Previous knowledge

- [Content management](content_management.md)
- [Content types](content_types.md) and [content items](content_model.md#content-items)

Check failure on line 23 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L23

[Ibexa.SpacingNestedList] In nested lists use 4 spaces instead of 2.
Raw output
{"message": "[Ibexa.SpacingNestedList] In nested lists use 4 spaces instead of 2.", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 23, "column": 1}}}, "severity": "ERROR"}
- [Taxonomy](taxonomy.md)

Check failure on line 24 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L24

[Ibexa.SpacingNestedList] In nested lists use 4 spaces instead of 2.
Raw output
{"message": "[Ibexa.SpacingNestedList] In nested lists use 4 spaces instead of 2.", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 24, "column": 1}}}, "severity": "ERROR"}
- [Templating](templating.md)

### Ibexa DXP edition

[[= product_name_headless =]] is the minimal edition required for this training.

- [[= product_name_headless =]] [[= latest_tag_4_6 =]]
- [[= product_name_exp =]] [[= latest_tag_4_6 =]]
- [[= product_name_com =]] [[= latest_tag_4_6 =]]

TODO: Make sure that everything used is in Ibexa DXP Headless scope, so to speak, ibexa/product-catalog

Check failure on line 35 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L35

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 35, "column": 44}}}, "severity": "ERROR"}

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.

Check failure on line 37 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L37

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 37, "column": 27}}}, "severity": "ERROR"}

### Cluster elements

This training can be run on the minimal stack.

| Service | Required | Value |
|--------------:|:--------:|:-------------|
| Search engine | No | (Legacy) |
| Cache pool | No | (Filesystem) |
| HTTP cache | No | |

### Starting state

To follow this training, you must install code, config and data on top of a fresh installation.

Check warning on line 51 in docs/trainings/commerce/pim/000_syllabus.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/000_syllabus.md#L51

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/trainings/commerce/pim/000_syllabus.md", "range": {"start": {"line": 51, "column": 1}}}, "severity": "WARNING"}

TODO: Experience clean install, or previous bike ride design and content?
184 changes: 184 additions & 0 deletions docs/trainings/commerce/pim/011_product_modeling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
---

Check warning on line 1 in docs/trainings/commerce/pim/011_product_modeling.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/011_product_modeling.md#L1

[Ibexa.ReadingLevel] The grade level is 5.75. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 5.75. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/trainings/commerce/pim/011_product_modeling.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: "PIM training: Product modeling"
edition: experience
page_type: training
---

# Product modeling

## Product types

The product type base concept is close to the content type one.
Like a content type structures a family content items, a product type structures products.

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

In fact, a product type is really a content type from the hidden system group `product` with a field of type “Product specification” (`ibexa_product_specification`).

The presence of an `ibexa_product_specification` field is what distinct product type from content type.
Don't remove this field from a product type (or it will become a unreachable hidden content type).

Check warning on line 19 in docs/trainings/commerce/pim/011_product_modeling.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/011_product_modeling.md#L19

[Ibexa.FutureTense] Use present tense instead of future.
Raw output
{"message": "[Ibexa.FutureTense] Use present tense instead of future.", "location": {"path": "docs/trainings/commerce/pim/011_product_modeling.md", "range": {"start": {"line": 19, "column": 52}}}, "severity": "WARNING"}
Don't add such field to a content type (or it will become an uneditable broken product type).

Check warning on line 20 in docs/trainings/commerce/pim/011_product_modeling.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/011_product_modeling.md#L20

[Ibexa.FutureTense] Use present tense instead of future.
Raw output
{"message": "[Ibexa.FutureTense] Use present tense instead of future.", "location": {"path": "docs/trainings/commerce/pim/011_product_modeling.md", "range": {"start": {"line": 20, "column": 47}}}, "severity": "WARNING"}

TODO: What happens if you have several `ibexa_product_specification` fields?

You can trick the system URL to display a product type as a content type but know that this is dangerous and mustn't be exposed to final users.
Always prefer the dedicated route (as the Back Office does) `/product-type/view/<product_type_identifier` (`ibexa.product_catalog.product_type.view`).
To view it through `/contenttypegroup/<product_group_id>/contenttype/<product_type_id>` (`ibexa.content_type.view`) is doable. You could even edit it from there. But this is strongly not recommended.

TODO: move to somewhere in the exercise
If you're curious, after having created a product type, you can run the following SQL query to see the database representation.

```sql
SELECT cg.group_id, cg.group_name, g.is_system, c.id, c.identifier, c.version
FROM ezcontentclass AS c
JOIN ezcontentclass_classgroup AS cg ON c.id = cg.contentclass_id AND c.version = cg.contentclass_version
JOIN ezcontentclassgroup AS g ON cg.group_id = g.id
ORDER BY cg.group_id ASC, c.id ASC
;
```

The "Product specification" field type (`ibexa_product_specification`) brings in the power of attributes.

Check failure on line 40 in docs/trainings/commerce/pim/011_product_modeling.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/011_product_modeling.md#L40

[Ibexa.DomainTermCapitalization] Use 'Field Type' instead of 'field type'
Raw output
{"message": "[Ibexa.DomainTermCapitalization] Use 'Field Type' instead of 'field type'", "location": {"path": "docs/trainings/commerce/pim/011_product_modeling.md", "range": {"start": {"line": 40, "column": 29}}}, "severity": "ERROR"}

Notice that you don't need to add a field or an attribute for price.
Prices are handled by a particular side mechanism, the price engine, which is treated later in the training with VAT, currencies, etc.

adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
## Attributes VS Fields

Like fields, attributes are typed.

Unlike fields, attributes are never translatable.
Attributes are product constant properties.
Attributes values can't be translated because those properties don't change with the language.
Only the display of those properties changes with the language. See the following concept examples:

- The color of a product is the same whatever the language is, only the corresponding color name is translated.
- The radius of a sphere doesn't depend on the language, only its numeral representation need translation according to local length units.

TODO: Later in the training, in the templating part, is shown how to localize the attributes.

Unlike fields, attributes are first defined outside the product types.
Attributes and attribute groups are to be reused from product type to product type.

An attribute can be used to make product variant.

TODO: Best practices:
How to think product types?
How to not have a product type per product?
How to not want a "god" product type trying to cover everything?

TODO: Variants
TODO: attribute value display translation

## Product and product variants

Technically, a product is a content item.

But a variant isn't.

TODO: Continue content VS product VS variant

## Exercise: Bikes and bike parts modeling

Exercise: Think about attributes and content type to sell full bicycles and bicycle parts.

The following is an example of a bicycle feature model sketch.
As you can see, it's a rich and complex matrix.
And it doesn't involve different brands and models for the same feature yet.

- Bicycle:
- Frameset:
- Frame:
- Size: [XS, S, M, L, XL]
- Shape/Features: [Diamond, Step-through, Diamond w/ suspension, Folding, Recumbent, Cargo, Tandem, …]
- Material: [Steel, Aluminium, Titanium, Carbon, Wood, Bamboo, Mixed, …]
- Paint job: […]
- Fork
- Size: [XS, S, M, L, XL]
- Suspension: yes/no
- Paint job: […]
- Handlebar:
- Shape: [Standard, Drop, Bullhorn, Flat, Riser, …]
- Paint job: […]
- Saddle:
- Shape: [Thin, Large, Noseless, …]
- Cushion material: [Foam, Gel, …]
- Cover material: [Spandex, Vinyl, Kevlar, Leather, …]
- Paint job: […]
- Saddlepost:
- Material: [Steel, Aluminium, Titanium, Carbon, Wood, Bamboo, Mixed, …]
- Type: [Rigid, Suspension, Dropper, …]
- Attachment: [Quick release, Bolt/nut, Anti-thief, …]
- Gears:
- Front gears:
- Speed count: [1…3]
- Type: [Single, External, Hub internal, Crank gearbox, …]
- Control transmission: [Bowden cable, Hydraulic, Electronic, …]
- Control type: [Lever, Ring, …]
- Control placement: [Handlebar, Frame, …]
- Rear gears:
- Speed count: [1…8]
- Control type: [Bowden cable, Hydraulic, Electronic, …]
- Type: [Single, External, Hub internal, Crank gearbox, …]
- Control transmission: [Bowden cable, Hydraulic, Electronic, …]
- Control type: [Lever, Ring, …]
- Control placement: [Handlebar, Frame, …]
- Transmission: [Chain, Belt, Shaft, …]
- Wheel set:
- Rear wheel:
- Axle attachment: [Quick release, Bolt/nut, Thru, Anti-thief, …]
- Diameter: [622 mm (road 700C, mountain 29″), 584 mm (road 650B, mountain 27.5″), 559 mm (mountain 26″), 406 mm (mountain 20″), …]
- Type: [Standard spokes, G3 spokes, Disc, …]
- Brake: [Caliper, Disk, Roller, Drum, …]
- Rim material: [Aluminium, Steel, Carbon, …]
- Tire shape: [City, Race, Mountain, Fat, Mixed, …]
- Tire insert: [Clincher/Tube, Tubular, Tubeless, Foam, Solid, …]
- Paint job: […]
- Front wheel:
- Same as rear: ☑yes/☐no
- Axle attachment: [Same as rear, Quick release, Bolt/nut, Thru, Anti-thief, …]
- Diameter: [Same as rear, 622 mm (road 700C, mountain 29″), 584 mm (road 650B, mountain 27.5″), 559 mm (mountain 26″), 406 mm (mountain 20″), …]
- Type: [Same as rear, Standard spokes, G3 spokes, Disc, …]
- Brake: [Same as rear, Caliper, V, Disk, Roller, …]
- Rim material: [Same as rear, Aluminium, Steel, Carbon, …]
- Tire shape: [Same as rear, City, Race, Mountain, Fat, Mixed, …]
- Tire insert: [Same as rear, Clincher/Tube, Tubular, Tubeless, Foam, Solid, …]
- Electric assistance:
- Electric assistance: ☐yes/☑no
- Motor placement: [Front wheel, Rear wheel, Crank, …]
- Battery placement: [Center, Rear, …]
- Regulation: [EU pedelec, EU speed pedelec, …]

A bad practice would be to try to have a unique product type for modeling all the bikes from the catalog.
For example, series of product won't necessarily vary on the same attributes.
TODO: To have one product type per base product can happen.




Mountain Bike (MTB)
- MTB 4 series
- Fuji (3776€) (MTBS4-4)
- Frame: [Diamond, Step-through]
- TODO
- Matterhorn (4478€) (MTBS4-5)
- Annapurna (8091€) (MTBS4-6)
- Frame: [Diamond w/ suspension]
- Etna (3369€) (MTBS4-7)
- MTB 5 series
- Kilimanjaro (5895€) (MTBS5-0)
- Stádda (1392€) (MTBS5-1)
- Aconcagua (6960€) (MTBS5-2)
- Ventoux (1910€) (MTBS5-3)
- Castor (4225€) (MTBS5-4)


- Create the attribute groups
- Create the attributes
- Create the product types
- Create the products

TODO: Variants
TODO: [Create custom product code generator strategy](create_product_code_generator.md)

Check warning on line 181 in docs/trainings/commerce/pim/011_product_modeling.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/011_product_modeling.md#L181

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/trainings/commerce/pim/011_product_modeling.md", "range": {"start": {"line": 181, "column": 88}}}, "severity": "WARNING"}

Your new products are in the "Uncategorized products" section of the **Products** admin page.
It's now time to fix this in the next chapter.
43 changes: 43 additions & 0 deletions docs/trainings/commerce/pim/012_product_shelving.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

Check warning on line 1 in docs/trainings/commerce/pim/012_product_shelving.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/trainings/commerce/pim/012_product_shelving.md#L1

[Ibexa.ReadingLevel] The grade level is 9.56. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 9.56. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/trainings/commerce/pim/012_product_shelving.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: "PIM training: Product shelving"
edition: experience
page_type: training
---

# Product shelving

There is several ways to group and sort products. TODO

## Catalogs

[Catalogs](catalogs.md) group products by filtering on product data.

TODO: What having several catalogs implies (navigation, customer experience,…)
TODO: How catalogs are displayed? Move this concern to "Product displaying"
TODO: [Create custom catalog](create_custom_catalog_filter.md)

## Categories

Product categories are tags in the `product_categories` [taxonomy](taxonomy.md).

If you're curious, you can find the `product_categories` taxonomy configuration in `vendor/ibexa/product-catalog/src/bundle/Resources/config/prepend.yaml`.

TODO: Something interesting to do using the Taxo API?

Exercise:

- Create a "Mountain Bike" category with two child categories "4 Series" and "5 Series"
- Categorize the products from previous chapter's exercise into the right series:

- Mountain Bike
- 4 Series
- Fuji
- Matterhorn
- Annapurna
- Etna
- 5 Series
- Kilimanjaro
- Stádda
- Aconcagua
- Ventoux
- Castor
Loading
Loading