Hi @buzzbuzz,
Thanks for the post.
If the code is not returning the right results, probably it has something to do with incorrect data from this line:
<?php $ht_p_order = $_GET[ 'price_order' ]; ?>
To fix this, the first step would be to debug the value of the $ht_p_order to check if it is returning the expected results on the page like so:
echo '<pre>';
var_dump( $ht_p_order );
echo '</pre>';