Skip to content

Commit

Permalink
Add locale code (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Allacher <[email protected]>
  • Loading branch information
AndreasA and Andreas Allacher authored Mar 22, 2022
1 parent dffa1ce commit a90c387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ After
// either were already synchronized or are also listed in the array
$taxonMessageProducer->synchronize([$taxon1, $taxon2, $taxon3]);
```
### Product attribute payload

The product attribute payload has changed. It is now stored in `attributeValues` and its content is slightly different.
5 changes: 4 additions & 1 deletion src/Producer/Serializer/ProductSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ protected function getAttributeValues(ProductInterface $product): array
foreach ($product->getAttributes() as $attributeValue) {
/** @var AttributeInterface $attribute */
$attribute = $attributeValue->getAttribute();
$attributeValues[$attributeValue->getCode()] = [
$key = \sprintf('%1$s|%2$s', $attributeValue->getCode(), $attributeValue->getLocaleCode() ?? '_null_');
$attributeValues[$key] = [
'code' => $attributeValue->getCode(),
'localeCode' => $attributeValue->getLocaleCode(),
'value' => $attributeValue->getValue(),
'attribute' => [
'id' => $attribute->getId(),
'code' => $attribute->getCode(),
'type' => $attribute->getType(),
'translatable' => $attribute->isTranslatable(),
'translations' => $this->getAttributeTranslations($attribute),
'configuration' => $attribute->getConfiguration(),
'customData' => $this->getCustomData($attribute),
Expand Down

0 comments on commit a90c387

Please sign in to comment.