cancel
Showing results for 
Search instead for 
Did you mean: 

active product_count in categories search

0 Kudos

active product_count in categories search

Feature request from povesma, posted on GitHub Oct 23, 2016

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": [] }

1 Comment
New Member

Comment from pboisvert, posted on GitHub Nov 04, 2016

@povesma thanks for the suggestion

@mbrinton01 passing to you until Misha is ramped up