@beka, let me second my appreciation for this sort! (I’ve even just now joined WP & GitHub in order to do so.)
I’m pretty new to WP and WC (but was a programmer — back when they called them that! — early on in my business career), and got the code to work!
I don’t think I’m knowledgeable enough yet to figure this out on my own, but, for my own WC site I’m building, I’d like to:
(1) make the “sort by SKU” choice the default product search, and
(2) make it the first choice in the product sort pull-down menu on the front-end – (perhaps doing (1) accomplishes (2)?), and
(3) call “sort by SKU” something else in that menu. (In my case, it would be “Country / Scott #”.)
Here’s the site, such as it is:
https://www.philatarium.net
Thanks mucho in advance for any light you can shed on this!
Edited to add: As of this writing, the “sort by SKU” is called “Country then Scott” and is the last pulldown option.