Skip to content

Commit 8202eca

Browse files
committed
MC-15250: Explicit product sorting in PageBuilder Products Content type
- Fix price sort
1 parent 07158a3 commit 8202eca

File tree

1 file changed

+3
-5
lines changed
  • app/code/Magento/PageBuilder/Model/Catalog/Sorting

1 file changed

+3
-5
lines changed

app/code/Magento/PageBuilder/Model/Catalog/Sorting/Price.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ public function __construct(
4343
public function sort(
4444
\Magento\Catalog\Model\ResourceModel\Product\Collection $collection
4545
): \Magento\Catalog\Model\ResourceModel\Product\Collection {
46-
$collection->joinAttribute('sorting_price', 'catalog_product/price', 'entity_id', null, 'left');
47-
$collection->getSelect()
48-
->reset(Select::ORDER)
49-
->order('sorting_price '.$this->sortDirection)
50-
->order('entity_id');
46+
$collection->getSelect()->reset(Select::ORDER);
47+
$collection->addAttributeToSort('price', $this->sortDirection);
48+
$collection->addAttributeToSort('entity_id', $this->sortDirection);
5149

5250
return $collection;
5351
}

0 commit comments

Comments
 (0)