Sure, that's possible. *winks*. Nearly anything is possible in Magento.
Take a look at the Mage_Catalog_Block_Product_List_Toolbar
class. This class handles the ordering of the product collection that is then used to create the product list; specifically, I'd focus on the getCurrentOrder()
and setCollection()
methods. I suggest creating a block that extends it, and then use that block as a replacement for the original one in layout XML.
You'll need to override the setCollection()
method. On lines 232 and 233 of the class, there's a perfect way for you to hook in and modify the functionality. After the order's existence is checked, you can add an additional check to make sure that it's the sort method you want. Then, after the order is set, you can add the code to add an attribute as a filter (addAttributeToFilter()
).
Make sure that you don't edit any core code in the process - my suggestions should be implemented in the class that extends the core block.
Please let me know if you have any questions.
Edit: After writing the above, I noticed there's a better way:
In the block that "owns" that collection, after the collection is set, an event is fired that would allow you to do everything you needed to: catalog_block_product_list_collection
. I suggest listening to that event, and then implementing the sort check and attribute filtering in the observer.
Once again, if you have questions, let me know.