Preconditions and environment
- Magento version: 2.4.6-p4
Steps to reproduce
- Create a product attribute: attribute label "Is Featured", attribute code "is_featured" and type is Yes/No and sortable.
- Go to Attribute Sets and assign the "Is Featured" product attribute to the "Bag" attribute set.
- Open the product. SKU: 24-MB03
- Enable the "Is Featured" product attribute and save it.
- In the product search criteria, use the API method "GET" and add this URL, and run it for page 1.
https://example.com/rest/V1/products?searchCriteria[currentPage]=1&searchCriteria[pageSize]=9&search... - In the product search criteria, use the API method "GET" and add this URL, and run it for page 4. (In other pages as well)
https://example.com/rest/V1/products?searchCriteria[currentPage]=4&searchCriteria[pageSize]=9&search...
Expected result
In the API response output, if I set the sort order of the boolean product attribute, it should show unique products on every page.
Actual result
-> On page number one: ID 3 which we have enabled the "is_featured" product attribute So It's coming first.
{ "items": [ { "id": 3 }, { "id": 1 }, { "id": 2 }, { "id": 4 }, { "id": 5 }, { "id": 6 }, { "id": 7 }, { "id": 8 }, { "id": 9 } ] }
-> On page number four: I have found the duplicates products
{ "items": [ { "id": 9 }, { "id": 8 }, { "id": 7 }, { "id": 6 }, { "id": 5 }, { "id": 4 }, { "id": 2 } ] }