Skip to content

Commit da64ad6

Browse files
gdemarsicokiatng
andauthored
Fix products duplicate across pagination when they have the same position value (#4750)
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
1 parent 76238cc commit da64ad6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
15201520
// optimize if using cat index
15211521
$filters = $this->_productLimitationFilters;
15221522
if (isset($filters['category_id']) || isset($filters['visibility'])) {
1523-
$this->getSelect()->order('cat_index.position ' . $dir);
1523+
$this->getSelect()->order(['cat_index.position ' . $dir, 'e.entity_id ' . $dir]);
15241524
} else {
15251525
$this->getSelect()->order('e.entity_id ' . $dir);
15261526
}

0 commit comments

Comments
 (0)