File: /home/dermova/www/india/wp-content/themes/ri-colias/woocommerce/yith-woocommerce-ajax-search.php
<?php
/**
* YITH WooCommerce Ajax Search template
*
* @author Your Inspiration Themes
* @package YITH WooCommerce Ajax Search
* @version 1.1.1
*/
if ( !defined( 'YITH_WCAS' ) ) { exit; } // Exit if accessed directly
wp_enqueue_script('yith_wcas_jquery-autocomplete' );
global $rit_settings;
?>
<form role="search" method="get" id="yith-ajaxsearchform" action="<?php echo esc_url( home_url( '/' ) ) ?>" class="yith-ajaxsearchform-container searchform <?php if (isset($rit_settings['search-cats']) && $rit_settings['search-cats']) echo 'searchform-cats'; ?>">
<fieldset>
<span class="text"><input name="s" id="yith-s" type="text" value="<?php echo get_search_query() ?>" placeholder="<?php echo esc_html__('Search…', 'ri-colias'); ?>" /></span>
<?php
if (isset($rit_settings['search-cats']) && $rit_settings['search-cats']) {
$args = array(
'show_option_all' => esc_html__( 'All Categories', 'ri-colias' ),
'hierarchical' => 1,
'class' => 'cat',
'echo' => 1
);
$args['taxonomy'] = 'product_cat';
$args['name'] = 'cat';
wp_dropdown_categories($args);
}
?>
<span class="button-wrap"><button class="btn" id="yith-searchsubmit" title="<?php esc_html__('Search', 'ri-colias'); ?>" type="submit"><i class="fa fa-search"></i></button></span>
<input type="hidden" name="post_type" value="product" />
</fieldset>
</form>
<script type="text/javascript">
jQuery(function($){
var search_loader_url = '<?php echo esc_url(rit_uri . '/images/ajax-loader@2x.gif') ?>';
$('#yith-s').<?php echo version_compare(YITH_WCAS_VERSION, '1.3.1', '>=') ? 'yithautocomplete' : 'autocomplete' ?>({
minChars: <?php echo get_option('yith_wcas_min_chars') * 1; ?>,
appendTo: '.yith-ajaxsearchform-container',
serviceUrl: woocommerce_params.ajax_url + '?action=yith_ajax_search_products'<?php echo (isset($rit_settings['search-cats']) && $rit_settings['search-cats']) ? " + '&cat=' + $('.yith-ajaxsearchform-container #cat').val()" : "" ?>,
onSearchStart: function(){
$(this).css('background', 'url('+search_loader_url+') no-repeat 97% center');
$(this).css('background-size', '16px 16px');
},
onSearchComplete: function(){
$(this).css('background', 'transparent');
},
onSelect: function (suggestion) {
if( suggestion.id != -1 ) {
window.location.href = suggestion.url;
}
}
});
});
</script>