Tagged: enfold, search, woocommerce
-
AuthorPosts
-
May 14, 2014 at 6:44 pm #264836
Hello,
Is it possible to replace the standard Enfold search engine with the WooCommerce widget product search?
Regards
Christian
May 15, 2014 at 6:55 am #265120Hey 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,
IsmaelJuly 17, 2015 at 9:42 am #474750I’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?
July 17, 2015 at 9:52 am #474755Hey!
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/customizationLet us know if we could do anything else, regarding our theme
Cheers!
BasilisJuly 17, 2015 at 9:57 am #474757Fair enough, thanks. But even the placeholder text issue? Seems like a glitch
July 17, 2015 at 1:23 pm #474911July 17, 2015 at 1:25 pm #474914Sure:
July 20, 2015 at 10:03 am #475655Hey!
I checked the search field and the placeholder “Search” is removed when you input a keyword or search something.
Cheers!
IsmaelJuly 20, 2015 at 10:17 am #475662Hi 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! :)
-
AuthorPosts
- The topic ‘Replace standard search with WooCommerce product search?’ is closed to new replies.