Skip to content

Commit 772faf2

Browse files
committed
Update categoryProduct.php
1 parent db9a276 commit 772faf2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: categoryProduct.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function launch()
3434
}
3535
if ($categoryId) {
3636
$category->load($categoryId);
37-
# Get _productCollection use layerCategory
37+
# Get _productCollection random
3838
$_productCollection = $category->getProductCollection()
3939
->addAttributeToSelect($catalogConfig->getProductAttributes())
4040
->addMinimalPrice()
@@ -46,6 +46,7 @@ public function launch()
4646
->setPageSize(10)
4747
->setCurPage(1);
4848

49+
$_productCollection->getSelect()->order('rand()');
4950
echo __('This category have %1 products!', $_productCollection->count());
5051
} else {
5152
echo __('This category not exist!');

0 commit comments

Comments
 (0)