Skip to content

active product_count in categories search #7147

@povesma

Description

@povesma

It is very useful to know number of active products (status = 1) in the search categories API call. Currently we can see total number of all products (including disabled).

Preconditions

Magento 2.1.2

Steps to reproduce

  1. /rest/V1/categories?root_category_id=24

Expected result

{
"id": 24,
"parent_id": 23,
"name": "Best Sellers",
"is_active": true,
"position": 2,
"level": 3,
"product_count": 5,
"active_product_count": 3, <---- add this one or similar, showing active products only
"children_data": []
}

Actual result

{
"id": 24,
"parent_id": 23,
"name": "Best Sellers",
"is_active": true,
"position": 2,
"level": 3,
"product_count": 5, <---- total product count only, which includes disabled products
"children_data": []
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions