Skip to content

Commit 5bbfc98

Browse files
mohaelmrabet-sqlisumesh-GL
authored andcommitted
Fix: preserve existing store labels when updating attribute option via API (issue #40093) - Updated
1 parent 014408c commit 5bbfc98

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ private function saveOption(
154154
foreach ($existingLabels as $storeId => $labelText) {
155155
$options['value'][$optionId][$storeId] = $labelText;
156156
}
157+
157158
if (is_array($option->getStoreLabels())) {
158159
foreach ($option->getStoreLabels() as $label) {
159160
$options['value'][$optionId][$label->getStoreId()] = $label->getLabel();
@@ -162,6 +163,7 @@ private function saveOption(
162163
if ($option->getIsDefault()) {
163164
$attribute->setDefault([$optionId]);
164165
}
166+
165167
$attribute->setOption($options);
166168
try {
167169
$this->resourceModel->save($attribute);

0 commit comments

Comments
 (0)