Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #264836

    Hello,

    Is it possible to replace the standard Enfold search engine with the WooCommerce widget product search?

    Regards

    Christian

    #265120

    Hey AscenderDesign!

    Thank you for using the theme!

    Edit searchform.php, remove everything then replace it with this code:

    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
    			<div>
    				<label class="screen-reader-text" for="s">Search for:</label>
    				<input type="text" value="<?php _e('search site', 'avia_framework')?>" name="s" id="s" placeholder="Search for products">
    				<input type="submit" id="searchsubmit" value="Search">
    				<input type="hidden" name="post_type" value="product">
    			</div>
    		</form>

    Regards,
    Ismael

    #474750

    I’ve just tried this, and there are a few problems: The placeholder text doesn’t clear when clicked in the search box, and also the nice little magnifying glass icon is replaced by the word “search” which is too big for the button!

    Any ideas please?

    #474755

    Hey!

    You will have to modify the design, to match the proper as it was. That needs some advanced knowledge of CSS and / or php if you can just modify it based on the existing one, by editing only the proper fields.

    If that is something you can not do, then

    You can contact one of our Customization Contractors, who will help you out with the process.
    http://kriesi.at/contact/customization

    Let us know if we could do anything else, regarding our theme

    Cheers!
    Basilis

    #474757

    Fair enough, thanks. But even the placeholder text issue? Seems like a glitch

    #474911

    Hey!

    Can you please post the link to your website?

    Best regards,
    Yigit

    #474914

    Sure:

    #475655

    Hey!

    I checked the search field and the placeholder “Search” is removed when you input a keyword or search something.

    Cheers!
    Ismael

    #475662

    Hi Ismael, I managed to fix it! I’m really not a programmer in any way, but kept hacking about with the above suggestion and the original file, and came up with this fix:

    <?php 
    
    global $avia_config; 
    
    //allows you to modify the search parameters. for example bbpress search_id needs to be 'bbp_search' instead of 's'. you can also deactivate ajax search by setting ajax_disable to true
    $search_params = apply_filters('avf_frontend_search_form_param', array(
    	
    	'placeholder'  	=> __('Search','avia_framework'),
    	'search_id'	   	=> 's',
    	'form_action'	=> home_url( '/' ),
    	'ajax_disable'	=> false
    ));
    
    $disable_ajax = $search_params['ajax_disable'] == false ? "" : "av_disable_ajax_search";
    
    $icon  = av_icon_char('search');
    $class = av_icon_class('search');
    ?>
    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
    			<div>
    				<label class="screen-reader-text" for="s">Search for:</label>
    				<input type="text"  name="s" id="s" placeholder='<?php echo $search_params['placeholder']; ?>' />
    				<input type="submit" id="searchsubmit" value="<?php echo $icon; ?>" class="button <?php echo $class; ?>" />
    				<input type="hidden" name="post_type" value="product">
    			</div>
    </form>

    Seems to work! :)

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Replace standard search with WooCommerce product search?’ is closed to new replies.