You can put the logic you need into a
&config file that retrieves the required sort order from the URL and sets a placeholder with a link for sorting in the other direction. Here it is with a fairly crude character link (could use an icon image; I really don’t think drop-downs should be used for simple 2-way choices on accessibility grounds):
In your document <div>[+priceDir+]</div>
[[Ditto? &config=`prices` etc.]]
Config file
prices.config.php in your ditto/configs folder
<?php
/* config file prices.config.php
* assumes price is a number in template variable "price"
*/
if ($_GET['order'] == 'desc') {
$order = 'price DESC';
$orderText = 'highest first <a href="[*id*]?order=asc">v</a>';
} else {
$order = 'price ASC';
$orderText = 'lowest first <a href="[*id*]?order=desc">^</a>';
}
// next line cribbed from the Ditto snippet call to generate the arrays needed
$orderBy = array('parsed'=>array(),'custom'=>array(),'unparsed'=>$order);
$modx->setPlaceholder('priceDir',$orderText);
$tpl= '@CODE:<div>[+title+][+price+]</div>';
?>

KP
(Based on example at
http://www.pogwatch.com/ditto/ditto-config.html)