Skip to content

Commit f6ee083

Browse files
Fix for flat tables
1 parent 10a9d42 commit f6ee083

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ public function process(
274274
// Create storage for future attributes
275275
$productAttributes[$productId] = [];
276276

277+
/**
278+
* @var Attribute $attribute
279+
*/
277280
foreach ($product->getAttributes() as $attributeCode => $attribute) {
278281
if (!$attribute->getIsVisibleOnFront()) {
279282
continue;
@@ -282,7 +285,7 @@ public function process(
282285
$productAttributes[$productId][$attributeCode] = [
283286
'attribute_code' => $attribute->getAttributeCode(),
284287
'attribute_type' => $attribute->getFrontendInput(),
285-
'attribute_label' => $attribute->getFrontendLabel(),
288+
'attribute_label' => $attribute->getStoreLabel(),
286289
'attribute_id' => $attribute->getAttributeId(),
287290
'attribute_options' => []
288291
];

src/Model/ResourceModel/Product/Collection.php

+5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ public function addAttributeToSelect($attribute, $joinType = false)
2929
if (!is_array($attribute)) {
3030
$attribute = [$attribute];
3131
}
32+
3233
foreach ($attribute as $attributeCode) {
34+
if (is_object($attributeCode)) {
35+
$attributeCode = $attributeCode->getAttributeCode();
36+
}
37+
3338
if ($attributeCode == '*') {
3439
foreach ($this->getEntity()->getAllTableColumns() as $column) {
3540
$this->getSelect()->columns('e.' . $column);

src/etc/module.xml

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<sequence>
1313
<module name="Magento_CatalogGraphQl"/>
1414
<module name="ScandiPWA_CatalogGraphQl"/>
15-
<module name="Magento_InventoryApi"/>
16-
<module name="Magento_CatalogInventory"/>
1715
</sequence>
1816
</module>
1917
</config>

0 commit comments

Comments
 (0)