I am trying to sort my products and I want to create a drop-down box so the user can sort by price etc. So far I have the following code in tpl_index_product_list.php: <form name="sorter" action="" method="get"><select name="sorter" onchange="this.form.submit();"> <OPTION SELECTED value="">Sort by... <OPTION value="&sortby=4a">Price <OPTION value="&sortby=3a">Artist Name <OPTION value="&sortby=2a">Size </SELECT> </FORM> How can I make it so that the sorter will work for any category, ie. dynamically choose which category? Thanks in advance.
Well your sql query could have ORDER BY '$sorter' DESC; at the end and $sorter could be whatever option the user selects. If its not selected, just make $sorter whatever you want the default order to be. If you need help with this, pm me.