We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Dynamically displaying categories > products in Perch Shop
I would like to be able to display Shop/Product Categories on a page that are dynamically updated if my client adds more categories/products.
I know that: perch_shop_products(); displays a list of all products
And I know I can add the property e.g. 'category' => 'my-category' and that will then display a list of all the products within that category. But this isn't dynamic and if for example I currently have two categories that I'd like to display separately on a page then I can do it by having:
<?php perch_shop_products([ 'category' => 'my-category-1' ]); ?> <?php perch_shop_products([ 'category' => 'my-category-2' ]); ?>
But what if my client adds another category to the back-end with some new products? Using the method above these products wouldn't display unless I hard-coded another perch_shop_products.
So my question: Is there a way that I can achieve what I'm after where categories/products can get added to a page automatically when generated by the client?
Want to reply to this thread?Login with Perch