File tree 1 file changed +8
-11
lines changed
src/Model/Resolver/Products/DataPostProcessor
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,6 @@ protected function appendWithValue(
128
128
129
129
// Remove all empty attributes
130
130
if (!$ attributeValue ) {
131
- // If attribute does not contain both value nor options then we remove it from output
132
- if (!isset ($ productAttributes [$ productId ][$ attributeCode ]) ||
133
- !$ productAttributes [$ productId ][$ attributeCode ]['attribute_options ' ]) {
134
- unset($ productAttributes [$ productId ][$ attributeCode ]);
135
- }
136
131
continue ;
137
132
}
138
133
@@ -200,6 +195,8 @@ protected function appendWithOptions(
200
195
!isset ($ productAttributes [$ id ][$ key ]['attribute_value ' ])
201
196
&& !count ($ variantAttributeValues )
202
197
) {
198
+ // Remove attribute if it has no value and empty options
199
+ unset($ productAttributes [$ id ][$ key ]);
203
200
continue ;
204
201
}
205
202
@@ -378,6 +375,12 @@ public function process(
378
375
}
379
376
}
380
377
378
+ $ this ->appendWithValue (
379
+ $ attributes ,
380
+ $ productIds ,
381
+ $ productAttributes
382
+ );
383
+
381
384
if ($ isCollectOptions ) {
382
385
$ this ->appendWithOptions (
383
386
$ attributes ,
@@ -387,12 +390,6 @@ public function process(
387
390
);
388
391
}
389
392
390
- $ this ->appendWithValue (
391
- $ attributes ,
392
- $ productIds ,
393
- $ productAttributes
394
- );
395
-
396
393
return function (&$ productData ) use ($ productAttributes ) {
397
394
if (!isset ($ productData ['entity_id ' ])) {
398
395
return ;
You can’t perform that action at this time.
0 commit comments