Config search order option on header search

This topic has 4 replies, 2 voices, and was last updated 1 week, 2 days ago ago by Jack Richardson

  • Avatar: javi_web
    javi_web
    Participant
    July 28, 2026 at 16:08

    Hello,
    How can I modify or customize how to order searched products result.
    I have tried: Appearance > Config > Woocommerce > Shop > Default Products order > Default ( Custom order + name)

    I have changed a product order (BÜTZMANN Q-18) to “1” I searched “Bützmann” again but it doesn’t appears the first one.

    Could you help me?

    Thank you.
    Regards,
    Javi.

    Please, contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    3 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    July 29, 2026 at 07:00

    Hello @javi_web,

    There is no such option available by default. However, if you wish to change it to make it custom sorted, you can use the following code in your child-theme/functions.php. Please choose one of the following choices below.

    1. To sort product results by price (cheapest first)

    add_filter('etheme_ajax_search_products_query', function ($args){
        $args['meta_key'] = '_price';
        $args['orderby'] = 'meta_value_num';
        $args['order'] = 'ASC';
        return $args;
    });

    2. To sort product results by popularity (best sellers first)

    add_filter( 'etheme_ajax_search_products_query', function ( $args ) {
    	$args['meta_key'] = 'total_sales';
    	$args['orderby']  = 'meta_value_num';
    	$args['order']    = 'DESC';
    	return $args;
    } );

    3. To sort by the “Menu order” value set on each product in WooCommerce -> Products

    add_filter( 'etheme_ajax_search_products_query', function ( $args ) {
    	$args['orderby'] = array(
    		'menu_order' => 'ASC',
    		'date'       => 'DESC',
    	);
    	return $args;
    } );

    Please let us know if any of these solutions are suitable for you. If you would like our assistance with implementing such snippets, we are available to help. However, we have not implemented it yet as we would like to confirm if this method is appropriate for your needs.

    Best Regards,
    Jack Richardson
    The 8Theme’s Team

    Avatar: javi_web
    javi_web
    Participant
    August 5, 2026 at 16:56

    Hello Jack,
    It worked! Thanks.
    It should be great if I can combine more than one. For example, sort by menu order and if products have the same order (very common) additionally sort by popularity. It’s only an example.

    In my opinion, in the meanwhile you can add it to the Elementor Widget as an option, publish it in the documentation page would be helpful.

    Thank you.
    Best Regards,
    Javi.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 6, 2026 at 07:21

    Dear @javi_web,

    We are grateful that our solution has met your needs. Should you wish to propose any future enhancements to our theme, please feel free to submit your suggestions at https://www.8theme.com/roadmap/. We will evaluate the popularity of your request based on customer votes.

    If your main request of this topic is solved, you can mark it as closed.

    Best regards,
    Jack Richardson
    The 8Theme’s Team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.