Skip to content

| PWA studio x magento 2 | Request for the “total pages” in category page return everytime “1”

When I display all my products in my category page, I have 20 products. But in the category I have 108 products, so there is supposed to be several page for this category, but I don’t have the pagination buttons. I search in the code and I found this :

if (totalPages === 1) {
    return null;
}

When I see this I search what the request return me. And I found the problem. With any category, the request return me "total_pages": 1 and only 20 products.

Here the response of my request

enter image description here

So I try to divide "total_count": 108 (all the products in category) by 20 (all the products display in one page) for have the total number of page. It’s work and I apply this total page in the pagination and I have all my pages. But when I want to change the page, it work but no items displayed. (I suspect the request return me only 20 products)

It is a problem in BO of magento ? If yes, how to fix it ?

Magento 2.4.2 | PWA-studio 13