Forum

Thread tagged as: Shop

Listing products by category

Hello again!

I'm quite happily listing products by category using the following code:

<?php
        perch_shop_products([
          'category'  =>  'event/book-challenge',
          'template'  =>  'products/product-box.html',
          'filter'    =>  'datetime',
          'match'     =>  'gte',
          'value'     =>  date('Y-m-d H:i:s'),
          'sort'      =>  'datetime'
        ]);
      ?>

I have another product category named book-challenge-external, but these products are showing in the book-challenge list.

Is this just a setup issue? Should I have a set named book-challenge with the categories differentiated within like 'event/book-challenge/external' rather than 'event/book-challenge-external'?

Chris McMahon

Chris McMahon 0 points

  • 3 years ago

Sub-categories, that's what I needed.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So all sorted now?

Yep, just needed a reply to close this out.