Forum

Thread tagged as: Question

Sort by Price, Using a Comma effects listing

How can I make my filter recognise that £1,234 is more money the £456. Currently my filter sees my prices which have a comma as small numbers.

This is my current code:

<?php
perch_content_custom('Products', array(
'template' => 'shop/product_listing.html',
'category' => 'boiler-type',
'sort-order'=>'ASC',
'sort-order'=>'numeric',
'sort'=>'extra1',
));
?>  

My product template for price is:

<h3 class="price">£<perch:content id="extra1" type="text" label="Buy from £" required="true" order="9" size="s" /><small> plus VAT</small></h3>
James Tedder

James Tedder 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Store the numbers as numbers: 1234 and 456 and format them when you output them.

Thanks