Skip to content

Commit

Permalink
Improve UPGRADE 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Jul 24, 2023
1 parent 361606a commit 29a5374
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,30 @@ imports:
protected function createTranslation(): ProductOptionTranslationInterface
{
```

6. The `Product` entity doesn't need to implement the `DocumentableInterface` anymore. You can remove it.

7. The way to add some additionnal data changed.

Before we should have this in your Product entity for example :

```php
use DocumentableProductTrait {
convertToDocument as parentConvertToDocument;
}

public function convertToDocument(string $locale): Result
{
$document = $this->parentConvertToDocument($locale);

if ($this->getCustomValue()) {
$document->addAttribute('custom_value', 'Custom Value', [$this->getCustomValue()], $locale, 1);
}

return $document;
}
```

Now please refer to the [Add custom value](docs/add_custom_values.md) documentation.

@TODO - Templating part

0 comments on commit 29a5374

Please sign in to comment.