Skip to content

Described virtual products and added an example creating product type with PHP API - #3024

Merged
mnocon merged 5 commits into
release-4.6.27from
product-type-nam
Feb 3, 2026
Merged

mnocon merged 5 commits into
release-4.6.27from
product-type-nam

Conversation

@mnocon

@mnocon mnocon commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Doc for https://ibexa.atlassian.net/browse/IBX-10630

Status: waiting for 4.6 release

Turns out we didn't have virtual products mentioned at all in the doc, so I'm adding a mention to the product guide.

Code tested locally:

Screenshot 2026-01-22 at 09 44 18

@mnocon
mnocon changed the base branch from 5.0 to 4.6 January 22, 2026 08:42
@mnocon mnocon changed the title product type nam Described virtual products and added an example creating product type with PHP API Jan 22, 2026
@mnocon
mnocon marked this pull request as ready for review January 22, 2026 09:25
@github-actions

Copy link
Copy Markdown

Preview of modified files

Preview of modified Markdown:


$marketingDescriptionFieldDefinition = $this->contentTypeService->newFieldDefinitionCreateStruct(
'marketing_description',
'ezstring'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: on upmerge, this should be ibexa_string

@mnocon
mnocon requested a review from a team January 22, 2026 12:51
@ibexa-workflow-automation-1
ibexa-workflow-automation-1 Bot requested review from adriendupuis, dabrt and julitafalcondusza and removed request for a team January 22, 2026 12:51
Comment thread docs/pim/product_api.md Outdated
@adriendupuis
adriendupuis self-requested a review January 27, 2026 12:45
mnocon and others added 2 commits January 27, 2026 13:47
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>

@adriendupuis adriendupuis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't straiten developers to virtual as being only digital.

Comment thread docs/pim/pim_guide.md Outdated
Comment thread docs/pim/pim_guide.md Outdated
Comment thread docs/pim/product_api.md Outdated
Comment thread code_samples/api/product_catalog/src/Command/ProductTypeCommand.php
Comment thread docs/pim/product_api.md
Comment thread docs/pim/product_api.md Outdated
@dabrt

dabrt commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

I would add a link somewhere that binds dev doc with user doc by pointing to:
https://doc.ibexa.co/projects/userguide/en/latest/pim/create_virtual_product/

@adriendupuis

Copy link
Copy Markdown
Contributor

I would add a link somewhere that binds dev doc with user doc by pointing to: https://doc.ibexa.co/projects/userguide/en/latest/pim/create_virtual_product/

@mnocon And I discover that the user doc doesn't have the "digital" bias and even quotes examples I was thinking of. 😉

mnocon and others added 2 commits January 29, 2026 11:54
Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/api/product_catalog/src/Command/ProductTypeCommand.php


code_samples/api/product_catalog/src/Command/ProductTypeCommand.php

docs/pim/product_api.md@110:``` php
docs/pim/product_api.md@111:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 43, 44) =]]
docs/pim/product_api.md@112:```
docs/pim/product_api.md@114:``` php
docs/pim/product_api.md@115:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 62, 66) =]]
docs/pim/product_api.md@116:```

001⫶ $productTypeCreateStruct = $this->localProductTypeService->newProductTypeCreateStruct(
002⫶ 'digital_product',
003⫶ 'eng-GB'
004⫶ );

docs/pim/product_api.md@120:``` php
docs/pim/product_api.md@121:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 67, 71) =]]
docs/pim/product_api.md@122:```

001⫶ $productTypeCreateStruct->setNames([
002⫶ 'eng-GB' => 'Digital Product',
003⫶ 'pol-PL' => 'Produkt Cyfrowy',
004⫶ ]);

docs/pim/product_api.md@126:``` php
docs/pim/product_api.md@127:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 72, 73) =]]
docs/pim/product_api.md@128:```

001⫶ $productTypeCreateStruct->setVirtual(true);

docs/pim/product_api.md@135:``` php
docs/pim/product_api.md@136:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 76, 83) =]]
docs/pim/product_api.md@137:```

001⫶ $marketingDescriptionFieldDefinition = $this->contentTypeService->newFieldDefinitionCreateStruct(
002⫶ 'marketing_description',
003⫶ 'ezstring'
004⫶ );
005⫶ $marketingDescriptionFieldDefinition->names = ['eng-GB' => 'Marketing Description'];
006⫶ $marketingDescriptionFieldDefinition->position = 100;
007⫶ $contentTypeCreateStruct->addFieldDefinition($marketingDescriptionFieldDefinition);

docs/pim/product_api.md@145:``` php
docs/pim/product_api.md@146:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 84, 85) =]]
docs/pim/product_api.md@147:```

001⫶ $sizeAttribute = $this->attributeDefinitionService->getAttributeDefinition('size');

docs/pim/product_api.md@151:``` php
docs/pim/product_api.md@152:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 86, 93) =]]
docs/pim/product_api.md@153:```

001⫶ $attributeAssignment = new AssignAttributeDefinitionStruct(
002⫶ $sizeAttribute,
003⫶ false,
004⫶ false
005⫶ );
006⫶
007⫶ $productTypeCreateStruct->setAssignedAttributesDefinitions([$attributeAssignment]);

docs/pim/product_api.md@161:``` php
docs/pim/product_api.md@162:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 94, 95) =]]
docs/pim/product_api.md@163:```

001⫶ $newProductType = $this->localProductTypeService->createProductType($productTypeCreateStruct);

docs/pim/product_api.md@169:``` php
docs/pim/product_api.md@170:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 96, 97) =]]
docs/pim/product_api.md@171:```

001⫶ $productType = $this->productTypeService->getProductType($productTypeIdentifier);


001⫶ $productType = $this->productTypeService->getProductType($productTypeIdentifier);

docs/pim/product_api.md@116:``` php
docs/pim/product_api.md@117:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 47, 52) =]]
docs/pim/product_api.md@118:```
docs/pim/product_api.md@175:``` php
docs/pim/product_api.md@176:[[= include_file('code_samples/api/product_catalog/src/Command/ProductTypeCommand.php', 100, 105) =]]
docs/pim/product_api.md@177:```

001⫶ $productTypes = $this->productTypeService->findProductTypes();
002⫶
003⫶ foreach ($productTypes as $productType) {
004⫶ $output->writeln($productType->getName() . ' with identifier ' . $productType->getIdentifier());
005⫶ }


001⫶ $productTypes = $this->productTypeService->findProductTypes();
002⫶
003⫶ foreach ($productTypes as $productType) {
004⫶ $output->writeln($productType->getName() . ' with identifier ' . $productType->getIdentifier());
005⫶ }

Download colorized diff

@adriendupuis
adriendupuis self-requested a review January 29, 2026 14:03
@mnocon mnocon added Wait with merge PRs that shouldn't be merged instantly and removed Needs DOC review labels Feb 2, 2026
@mnocon
mnocon changed the base branch from 4.6 to release-4.6.27 February 3, 2026 08:34
@mnocon
mnocon merged commit 20dec31 into release-4.6.27 Feb 3, 2026
8 checks passed
@mnocon
mnocon deleted the product-type-nam branch February 3, 2026 08:34
@mnocon mnocon mentioned this pull request Feb 3, 2026
mnocon added a commit that referenced this pull request Feb 3, 2026
… with PHP API (#3024)

* Described virtual products and added an example creating product type with PHP API

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>

* Fixed invalid include

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Added link to user doc

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
mnocon added a commit that referenced this pull request Feb 3, 2026
* Removed warning about Safari (#2982)

* 4.6.27: Update doc for dropped unused guzzle dependencies (#2995)

* Added update section for 4.6.27

* Update docs/update_and_migration/from_4.6/update_from_4.6.md

* Described virtual products and added an example creating product type with PHP API (#3024)

* Described virtual products and added an example creating product type with PHP API

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>

* Fixed invalid include

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Added link to user doc

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* [4.6] Doc for Elasticsearch 8 (#3022)

* Added doc for ES8

* Added update guide mention

* Fixed header

* Formatting fixes

* Apply suggestions from code review

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>

* Apply suggestions from code review

Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Manual changes

---------

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
mnocon added a commit that referenced this pull request Feb 3, 2026
* Removed warning about Safari (#2982)

* 4.6.27: Update doc for dropped unused guzzle dependencies (#2995)

* Added update section for 4.6.27

* Update docs/update_and_migration/from_4.6/update_from_4.6.md

* Described virtual products and added an example creating product type with PHP API (#3024)

* Described virtual products and added an example creating product type with PHP API

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>

* Fixed invalid include

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Added link to user doc

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* [4.6] Doc for Elasticsearch 8 (#3022)

* Added doc for ES8

* Added update guide mention

* Fixed header

* Formatting fixes

* Apply suggestions from code review

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>

* Apply suggestions from code review

Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Manual changes

---------

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
mnocon added a commit that referenced this pull request Mar 6, 2026
… with PHP API (#3024)

* Described virtual products and added an example creating product type with PHP API

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>

* Fixed invalid include

* Apply suggestions from code review

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>

* Added link to user doc

---------

Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
@mnocon mnocon removed the Wait with merge PRs that shouldn't be merged instantly label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants