Hi Max, Can I sort products in WEooCommerce by the SKU number?
Sort Products by SKU Number was last modified: July 24th, 2015 by
0 Answers
Yes you sure can. Open up your functions.php file in your child theme. If you are in your dashboard go to APPEARANCE > EDITOR > from the list of files on the far right look for functions.php
Add this line of code at the end of the file.
add_filter('woocommerce_get_catalog_ordering_args', 'wcs_woocommerce_catalog_orderby_sku');
function wcs_woocommerce_catalog_orderby_sku( $args ) {
$args['orderby'] = 'meta_value';
$args['meta_key'] = '_sku';
}
Answer for Sort Products by SKU Number was last modified: July 24th, 2015 by