I'm looking for some help with limiting the review list on the product page to 5 reviews at a time. I'm using Magento 2.0.7 and Porto 2.2.1
I found some suggestions on here but they were for Magento 1.x and didn't help me. What I tried so far:
$_items = $block->getReviewsCollection()->getItems();
$_items = $block->getReviewsCollection()->getItems()->setPageSize(5);
Result: No reviews shown at all. Payed around but got either no reviews or 10 as usual.
<block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"/>
<block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"> <argument name="setLimit" xsi:type="number">5</argument> </block>
I also played around in the
pager.phtml and even
pager.php with similar changes but got no results. What did I miss?
edit: Thanks, so far. Tried both changes, unfortunately I still get 10 reviews. Any chance that I need to change something somewhere else that I haven't noticed yet? Yes, cache was flushed, other changes were visible immediately.
edit: I experimented with application\magento\vendor\magento\module-theme\Block\Html\Pager.php and found out that changing $_availableLimit or $_limit brings the desired results BUT that's not the clean way to work on this. Is there anything I missed? Is the class correct? Is the argument correct at all?