Open
Description
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&searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=3&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&searchCriteria[filter_groups][1][filters][0][condition_type]=eq&searchCriteria[sortOrders][0][field]=is_featured&searchCriteria[sortOrders][0][direction]=desc&fields=items[id] - 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&searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=3&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&searchCriteria[filter_groups][1][filters][0][condition_type]=eq&searchCriteria[sortOrders][0][field]=is_featured&searchCriteria[sortOrders][0][direction]=desc&fields=items[id]
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 } ] }
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.