Forum

Thread tagged as: Question

Perch Paypal shop sort order

How can I get the category pages in a Perch Paypal shop to list by price order by default?

They is the current code I am using

<?php 
    perch_shop_products_by_category(perch_get('cat'), 24);
?>
James Tedder

James Tedder 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Use perch_shop_custom() instead - that's all perch_shop_products_by_category() is doing if you look under the hood.

perch_shop_custom([
    'category' => perch_get('cat'),
    'template' => 'product_in_list.html',
    'count' => 24,
    'sort' => 'productPrice',
]);