Skip to content

Commit e27a92b

Browse files
Merge pull request #13 from AleksandrsKondratjevs/issue-1951
Add back check for attribute visible on storefront
2 parents 4cdb0ac + c635a3a commit e27a92b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Model/Resolver/Products/DataPostProcessor/Attributes.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -293,21 +293,23 @@ protected function isAttributeSkipped(
293293
bool $isCompare
294294
): bool {
295295
/**
296+
* On PDP, If attribute is not visible on storefront
297+
* or has no label then we should skip it.
298+
*
296299
* On PLP, KEEP attribute if it is used on PLP.
297300
* This means if not visible on PLP we should SKIP it.
298301
*
299-
* On PDP, If attribute has no label then it shouldn't be
300-
* visible.
301-
*
302302
* Don't skip if attribute is for the compare page
303303
*/
304-
$result = !$attribute->getUsedInProductListing() || !$attribute->getStoreLabel();
304+
if ($isSingleProduct) {
305+
return !$attribute->getIsVisibleOnFront() || !$attribute->getStoreLabel();
306+
}
305307

306308
if ($isCompare) {
307-
$result = !$attribute->getIsComparable() || !$attribute->getIsVisible();
309+
return !$attribute->getIsComparable() || !$attribute->getIsVisible();
308310
}
309311

310-
return $result;
312+
return !$attribute->getUsedInProductListing();
311313
}
312314

313315
/**

0 commit comments

Comments
 (0)