Created
May 15, 2020 19:28
-
-
Save Musilda/e8c671dfc5c536f0b6713e7b7b6900fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_default_catalog_orderby', 'musilda_default_random_order' ); | |
function musilda_default_random_order(){ | |
return 'rand'; | |
} | |
add_filter( 'woocommerce_default_catalog_orderby', 'musilda_default_price_order' ); | |
function musilda_default_price_order(){ | |
return array( 'price', 'ASC' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment