Home Forums WoodMart support forum How can I set the mobile search bar to show only 5 products in dropdown list?

How can I set the mobile search bar to show only 5 products in dropdown list?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #562975

    Clarance
    Participant

    Thanks, it is working now in search result page.

    Another question: How can I set the mobile search bar to show only 5 products in dropdown list?

    #563129

    Luke Nielsen
    Keymaster

    Hello,

    Sorry, but there is no option in Theme Settings available for that. It requires customizations and this is beyond our limitations and support policy.

    If you’d like to contact us, we are here for whatever questions you may have.

    Kind Regards

    #582620

    Clarance
    Participant

    Hi,

    But, I can set the search results count in desktop header, and why it is removed this setting in mobile header?

    Screenshot: https://prnt.sc/vyovR1Ig9w4e

    #582846

    Luke Nielsen
    Keymaster

    Hello,

    1. In the wp-content\themes\woodmart\inc\modules\search.php file, you need to find this woodmart_search_form function and add the follow string $args = apply_filters( 'woodmart_search_form_args', $args ); as shown in this https://monosnap.com/file/FiCDog0yEwMPbPcVKF3W6C4ZLFsjD8 screenshot

    2. After that, in the child theme -> functions.php define the code below:

    add_filter(
    	'woodmart_search_form_args',
    	function ( $args ) {
    		$args['count'] = 5;
    
    		return $args;
    	}
    );

    This will change the number of search results for all search forms on all devices.

    Kind Regards

    #582912

    Clarance
    Participant

    Thanks, the code is working fine.

    Please also update this function in next version.

    #582988

    Luke Nielsen
    Keymaster

    Hello,

    Glad I could help! If you need further assistance, I’m here for you.

    Take care!

    Kind Regards

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How can I set the mobile search bar to show only 5 products in dropdown list?’ is closed to new replies.