• Hi,

    I’ve added a custom filter as follows:

    add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘custom_woocommerce_get_catalog_ordering_args’ );
    function custom_woocommerce_get_catalog_ordering_args( $args ) {
    $args[‘orderby’] = ‘_stock_order’;
    $args[‘order’] = ‘ASC’;
    $args[‘meta_key’] = ‘_stock_order’;
    return $args;
    }

    this works fine in catalog but when I go to a category/subcategory the above criteria gets ignored , any ideas how to get it working in this case?

    Thanks a bunch,
    Radu C

  • The topic ‘Order by custom meta key – works in catalog but not in categories/subcategories’ is closed to new replies.