Skip to content

Commit 008052e

Browse files
author
Stanislav Idolov
authored
ENGCOM-2316: hidden product attributes not intended for storefront #103
2 parents 7c99baa + de106e2 commit 008052e

File tree

1 file changed

+18
-0
lines changed
  • app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Attributes

1 file changed

+18
-0
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Attributes/Collection.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ public function getAttributes() : AttributeCollection
4646
$this->collection = $this->collectionFactory->create();
4747
$this->collection->addFieldToFilter('is_user_defined', '1');
4848
$this->collection->addFieldToFilter('attribute_code', ['neq' => 'cost']);
49+
$this->collection->addFieldToFilter(
50+
[
51+
'is_comparable',
52+
'is_filterable',
53+
'is_filterable_in_search',
54+
'is_visible_on_front',
55+
'used_in_product_listing',
56+
'used_for_sort_by'
57+
],
58+
[
59+
['eq' => '1'],
60+
['eq' => '1'],
61+
['eq' => '1'],
62+
['eq' => '1'],
63+
['eq' => '1'],
64+
['eq' => '1']
65+
]
66+
);
4967
}
5068

5169
return $this->collection->load();

0 commit comments

Comments
 (0)