Hello Community,
We are using Magento CE 2.2.8 and right now facing following things.
1. In ListProduct block Magento is using "initializeProductCollection()" to initialize the collection.
while initializing it dispatches event "catalog_block_product_list_collection" as follows.
$this->_eventManager->dispatch(
'catalog_block_product_list_collection',
['collection' => $collection]
);
Here no page size is set for the collection.
2. This event is having observer in Review Module (module-review)
<event name="catalog_block_product_list_collection">
<observer name="review" instance="Magento\Review\Observer\CatalogBlockProductCollectionBeforeToHtmlObserver" shared="false" />
</event>
3. The observer "Magento\Review\Observer\CatalogBlockProductCollectionBeforeToHtmlObserver" loading all the product collection. We have 3000 products and it loads all.
4. After product load "catalog_product_collection_load_after" is dispatched.
5. We have observer which is attached to this event "catalog_product_collection_load_after".
So we are getting all the items over there. and it impacts on performance.
So is it bug that Magento has not used page size while initializing product collection in ListProduct block ? Or is there any specific reason not to use a page size while initializing ?
If there is a specific reason then is there any way to handle this ?
Thanks in advanced !