After reading the source, I figured it out: In catalog/controller/product/category.php (or wherever you’re calling function model_catalog_product->getProducts) you have to add
|
|||
Another solution, rather than modifying the core files directly, is to use vQmod to modify the file for you. That way when you upgrade to a new version, you won’t have to re-install any custom modifications you’ve made. Below is an the code you’d use to accomplish this in vQmod:
|
|||
catalog/controller/product/category.php For Opencart Version 2.1.0.2, the solution of Ignacio works fines as well just that:
Then just add the line ’filter_sub_category’ => true, after line #170 ( Thanks Ignacio! |
Lähde: How to display products from subcategory to parent category in opencart? – Stack Overflow
$filter_data
, it’s at the line 170. – giovannipds May 16 ’16 at 3:38