File tree 1 file changed +8
-9
lines changed
app/code/Magento/Eav/Model/Entity/Attribute
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -158,17 +158,16 @@ private function getOptionId($option)
158
158
* @param string $optionLabel
159
159
* @return void
160
160
*/
161
- public function setOptionValue ($ option , $ attribute , $ optionLabel )
161
+ protected function setOptionValue ($ option , $ attribute , $ optionLabel )
162
162
{
163
- if ($ optionId = $ attribute ->getSource ()->getOptionId ($ optionLabel )) {
163
+ $ optionId = $ attribute ->getSource ()->getOptionId ($ optionLabel );
164
+ if ($ optionId ) {
164
165
$ option ->setValue ($ attribute ->getSource ()->getOptionId ($ optionId ));
165
- } else {
166
- if (is_array ($ option ->getStoreLabels ())) {
167
- foreach ($ option ->getStoreLabels () as $ label ) {
168
- if ($ optionId = $ attribute ->getSource ()->getOptionId ($ label ->getLabel ())) {
169
- $ option ->setValue ($ attribute ->getSource ()->getOptionId ($ optionId ));
170
- break ;
171
- }
166
+ } elseif (is_array ($ option ->getStoreLabels ())) {
167
+ foreach ($ option ->getStoreLabels () as $ label ) {
168
+ if ($ optionId = $ attribute ->getSource ()->getOptionId ($ label ->getLabel ())) {
169
+ $ option ->setValue ($ attribute ->getSource ()->getOptionId ($ optionId ));
170
+ break ;
172
171
}
173
172
}
174
173
}
You can’t perform that action at this time.
0 commit comments