Reputation: 107
How to get all products in a parent category (first level) in opencart?
including all subcategories and their products
All products under a menu(category) including its subcategory products(children)
Upvotes: 0
Views: 1889
Reputation: 16055
Considering You have ID of current category stored in $category_id
, You could try:
$data = array(
'filter_category_id' => $category_id,
'filter_sub_category' => true
);
$products = $this->model_catalog_product->getProducts($data);
Upvotes: 3