Magento2 Admin Panel > Products > Categories >

Select Any category > "Products in category"

When i try to load more products from select dropdown, some random products are showing in resultenter image description here


protected function _prepareCollection()


        $collection = $this->_products->getCollectionForGrid(
            (int) $this->getRequest()->getParam('id', 0)

        $collection = $this->_products->applyCachedChanges($collection);



        $idx = ($collection->getCurPage() * $collection->getPageSize()) - $collection->getPageSize();

        foreach ($collection as $item) {

        return $this;

I have try to debug and found that there is some issue with this script:


When i comment this script after that list view is working properly but grid view still have issue.

Thanks in advance.

Your Answer

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

Browse other questions tagged or ask your own question.