Created
March 4, 2016 15:25
-
-
Save kreamweb/eb507e8e22ae5c213819 to your computer and use it in GitHub Desktop.
Change order of search in woocommerce
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_get_catalog_ordering_args', 'ywcas_woocommerce_catalog_orderby'); | |
function ywcas_woocommerce_catalog_orderby( $args ) { | |
$args['orderby'] = 'meta_value'; | |
$args['order'] = 'asc'; | |
$args['meta_key'] = '_sku'; | |
return $args; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment