Skip to content

Commit cc084ff

Browse files
committed
#33010: Sort of related products in GraphQL not implemented
1 parent 9c42b97 commit cc084ff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/RelatedProductGraphQl/Model/DataProvider/RelatedProductDataProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public function getRelations(array $products, int $linkType): array
118118
$collection = $link->getLinkCollection();
119119
$collection->addFieldToFilter('product_id', ['in' => array_keys($productsByActualIds)]);
120120
$collection->addLinkTypeIdFilter();
121+
$collection->joinAttributes();
122+
$collection->addOrder('product_id');
123+
$collection->addOrder('position', 'asc');
121124

122125
//Prepare map
123126
$map = [];

0 commit comments

Comments
 (0)