I want to get the random 10 products from whole product collection in magento2.

$productCollection = $this



How to get the products without loading the whole product collection.


1 Answer 1


Try This :-

// Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $_collection
$collection = $this->_collection->create();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.