Add a sort by product name option to the default WooCommerce sorting

We often get asked this question and see a lot of clients using a plugin to achieve this simple request. How do you add a ‘Sort Alphabetically’ option to the standard WooCommerce product sorting drop-down option?

This is a very feature to add and all it requires is a bit of PHP, you can add the functionality needed to your theme functions.php file if you are using a child theme. You can also add it as a Snippets using the Code Snippets plugin.

The function neededThis function is pretty simple and adds the option to sort products by name alphabetically, in ascending order.