Forum

Thread tagged as: Problem, Shop

Blank Template for perch_shop_products()

when I use this, everything is okay ...

    perch_shop_products([
        'category' => $cat,
    ]);

but when I use this, it's blank ... even though, list_category.html is an exact copy of list.html (the default file the above code references)

    perch_shop_products([
        'template' => 'list_category.html',
        'category' => $cat,
    ]);

even if I do this, I still get a blank result

    perch_shop_products([
        'template' => 'list.html',
        'category' => $cat,
    ]);

not sure what I'm missing here :(

Blake Myers

Blake Myers 0 points

  • 4 years ago

Hi Blake,

This should work. Looks like the app is looking for templates inside the shop folder.

perch_shop_products([
'template' => 'products/list_category.html',
'category' => $cat,
]);

If you find yourself in similar situations, set debug to true and test different paths for the one that fails.

define('PERCH_DEBUG', true);

Thanks! That was it!