magento limiting number of returned items in product collection call

前端 未结 6 809
北荒
北荒 2021-02-04 11:10

Im trying to limit the number of returned results manually in a copy of the list.phtml template, but its turning out to be alot harder than I anticipated.

Ive tried man

6条回答
  •  囚心锁ツ
    2021-02-04 11:19

    I got the Code of User:clockworkgeek , but here is some issue and correct code is as follow, it work and thanks clockworkgeek.

    $_productCollection = $this->getLoadedProductCollection();
    $_productCollection->clear();
    $_productCollection->setPageSize(3)
    $_productCollection->load();
    

    You Also writeenter code here or solve this issue by modify as

    $this->getLoadedProductCollection()->clear();
    $_productCollection = $this->getLoadedProductCollection();
    

    Thanks, If it help you then comment.

提交回复
热议问题