Skip to content

Commit dd2e1a2

Browse files
authored
25038 Only set collection to toolbar once in ListProduct block
Fix for: magento#25038 When using ElasticSearch, pagination does not work in some cases if pagination is set multiple times (in the toolbar). The catalog does not show results when clicking past the first page of results in catalog. Only setting the $collection once fixes the issue.
1 parent cde4f67 commit dd2e1a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ private function configureToolbar(Toolbar $toolbar, Collection $collection)
516516
$toolbar->setModes($modes);
517517
}
518518
// set collection to toolbar and apply sort
519-
$toolbar->setCollection($collection);
519+
if (!$toolbar->getCollection()) {
520+
$toolbar->setCollection($collection);
521+
}
520522
$this->setChild('toolbar', $toolbar);
521523
}
522524
}

0 commit comments

Comments
 (0)