WooCommerce – add ‘Sort by On Sale’ option on archive pages

A function to add the option to sort product for on sale within WooCommerce.

The Sunset Of Magento One

With over 245,000 websites powered by Magento, it is one of the World’s largest eCommerce platforms.