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.



Try This :-

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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