Commit ccc1c6f 1 parent 4cdb0ac commit ccc1c6f Copy full SHA for ccc1c6f
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
@@ -376,6 +373,12 @@ public function process(
376
373
}
377
374
}
378
375
376
+ $ this ->appendWithValue (
377
+ $ attributes ,
378
+ $ productIds ,
379
+ $ productAttributes
380
+ );
381
+
379
382
if ($ isCollectOptions ) {
380
383
$ this ->appendWithOptions (
381
384
$ attributes ,
@@ -385,12 +388,6 @@ public function process(
385
388
);
386
389
}
387
390
388
- $ this ->appendWithValue (
389
- $ attributes ,
390
- $ productIds ,
391
- $ productAttributes
392
- );
393
-
394
391
return function (&$ productData ) use ($ productAttributes ) {
395
392
if (!isset ($ productData ['entity_id ' ])) {
396
393
return ;
You can’t perform that action at this time.
0 commit comments