<?php
/**
 * The template for displaying search forms in shrk
 *
 * @package shrk
 */

$form_id = uniqid( 'search-form' );
$shrk_ajax_search_enabled = function_exists( 'shrk_ajax_search_enabled' ) && shrk_ajax_search_enabled() ? true : false;
$global_search = shrk_get_theme_option( 'ajax_search_globally' ) || !$shrk_ajax_search_enabled ? true : false;
$placeholder = $global_search ? esc_html_x( 'Search &hellip;', 'placeholder', 'ux-shop' ) : esc_html_x( 'Search for products &hellip;', 'placeholder', 'ux-shop' );
?>
<form role="search" method="get" class="search-form <?php echo ( $shrk_ajax_search_enabled ) ? 'ajax-search' : ''; ?>" action="<?php echo esc_url( home_url( '/' ) ); ?>">
	<div id="<?php echo esc_attr( $form_id ); ?>">
		<div class="wrap-search"><input type="search" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php _ex( 'Search for:', 'label', 'ux-shop' ); ?>" data-swpparentel="#<?php echo esc_attr($form_id); ?> .wrap-results"></div>
		<div class="wrap-submit"><input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'ux-shop' ); ?>"></div>
		<div class="wrap-results"></div>
		<?php if ( !$global_search ) : ?>
		<input type="hidden" name="post_type" value="product">
		<?php endif;?>
	</div>
</form>
