Commerce Product listing View with category contextual filter, How to show items of (selected term and its child terms) I have a the view 'Browse Products by Category'

with the path: /taxonomy/term/%

and a contextual filter: Product: Category (field_category)

and let's say I have these categories:


Sensors


--- Accelerometers

--- Current Sensors

--- Direction Sensors


Robotics &amp; Motors


--- Dc Geared Motors

--- Digital Servo

--- Motor Drivers

then if I selected 'Sensors', I get no products, although there are products tagged with 'Accelerometers'

Is there anyway that I can configure view to show products in sub categories.

That could be done easily when showing contents but not commerce products, case content offers a contextual filter that supports depth out-of-box.
There are two approaches to solving this problem:


Use the product_taxonomy_filter module to add the missing filter. Note that the performance impact of this module is unclear (it adds a subquery since it can't rely on the taxonomy_index table).
Build your product catalog the recommended way, using Search API. The official docs cover this use case (via adding the "Index hierarchy") processor.