kreamweb
3/4/2016 - 3:25 PM

Change order of search in woocommerce

Change order of search in woocommerce

<?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;
}