@burt Hi Gary,
I have integrated this Product Sort Within Category successfully with the core sorting functionality. I even added the "Product Drag and Sort" you coded many years ago to make custom sorting of the products very easy. However, in <<general.php>> the function tep_create_sort_heading where the sorting table heading is built, it has the following piece of code:
$sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? LISTING_SORT_DOWN : LISTING_SORT_UP) : LISTING_SORT_UNSELECTED) . '</a>';
If the number of sort filters >9, substr($sortby, 0, 1) will not return the correct $colnum. Instead substr($sortby, 0, -1) will work.
This is just for your information - I guess 99.99% of shopowners will not have this issue.
Thanks, Eddy