Exclude Sub Categories For Perch Collection
I have a collection called 'Products'.
I also have a Category Set called 'Products' with categories and some sub-categories.
Some products can be assigned to a sub-category, while others just to a parent category.
How can I display products from a collection filtered just by parent category and exclude any products in sub-categories of that parent?
So to show products in a sub cat I'm doing this:
perch_collection('Products', [ 'template' => '_product_list', 'category' => 'products/' . perch_get('cat') . '/' . perch_get('subcat'), ]);
But when I try to just filter by one category deep, it renders all products from the parent cat and sub-cat:
perch_collection('Products', [ 'template' => '_product_list', 'category' => 'products/' . perch_get('cat') . '/', ]);
This doesn't work either:
perch_collection('Products', [ 'template' => '_product_list', 'category' => 'products/' . perch_get('cat'), ]);
Perch Runway: 3.0.8, PHP: 5.6.30, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO Server OS: Darwin, cgi-fcgi Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.5.1), perch_forms (1.9.1) App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', ]; PERCH_LOGINPATH: /admin PERCH_PATH: /Users/Toby/Sites/create-this/admin PERCH_CORE: /Users/Toby/Sites/create-this/admin/core PERCH_RESFILEPATH: /Users/Toby/Sites/create-this/admin/resources Image manipulation: GD PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7 Resource folder writeable: Yes SCRIPT_NAME: /admin/core/settings/diagnostics/index.php REQUEST_URI: /admin/core/settings/diagnostics/ DOCUMENT_ROOT: /Users/Toby/Sites/create-this HTTP_HOST: ct.loc:8888