Plugin Author
ILLID
(@mihail-barinov)
Hi,
So, as I understand, you want an option to submit an empty search form. So in this case what search results page must display – all available shop pages or maybe something else?
Regards
Yes, thats correct. It will display all available on shop page.
-
This reply was modified 4 years, 7 months ago by
mutalqureshi.
Plugin Author
ILLID
(@mihail-barinov)
Looks like I found the solution for you. Please use following code snippet
add_action( 'wp_head', 'my_aws_head' );
function my_aws_head() { ?>
<script>
window.addEventListener('load', function() {
jQuery('.aws-search-btn').on( 'click', function (e) {
var form = jQuery(this).closest('.aws-search-form');
var searchField = form.find('.aws-search-field');
if ( searchField.val() === '' ) {
searchField.val('');
window.location.href = '/shop/';
}
});
}, false);
</script>
<?php }
You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.
Regards