<?php if (class_exists('WooCommerce') && isset($args['header']) && $args['header'] == true): ?>
<form role="search" method="get" class="search-form tfwctool-search-form" autocomplete="off" action="<?php the_permalink(wc_get_page_id( 'shop' )); ?>">
    <div class="w-100 search-form-inner">
        <input type="search" class="input-text main-input-search tfwctool-auto-ajaxsearch-input" placeholder="<?php esc_attr_e('Search ','storez'); ?>" value="<?php the_search_query(); ?>" name="s" title="<?php esc_attr_e('Search for:','storez'); ?>" autcomplete="false">
        <div class="search-form-cat-container search-label">
            <?php 
                $swp_cat_dropdown_args = array(
                    'taxonomy'         => 'product_cat',
                    'show_option_all'  => esc_html__( 'All Categories', 'storez'),
                    'name'             => 'product_cat',
                    'class'            => 'search-form-categories',
                    'value_field'      => 'slug',
                    'selected'         => (isset($_GET['product_cat']) && $_GET['product_cat'])?sanitize_text_field($_GET['product_cat']):false,
                );
                wp_dropdown_categories( $swp_cat_dropdown_args );
             ?>
            <input type="hidden" name="post_type" value="product">
            <button type="submit" class="main-search-submit" >
                <i class="fa fa-search"></i>
                <i class="fa fa-refresh fa-spin process-bar"></i>
            </button>
        </div>
        <div class="tfwctool-search-result-container"></div>
    </div>
</form>
<?php else: ?>
<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ) ?>">
    <div>
        <label class="screen-reader-text" for="s"><?php esc_html_e( 'Search for:', 'storez') ?></label>
        <input type="text" class="search-field" value="<?php echo esc_attr(get_search_query()); ?>" name="s" id="s" />
        <button class="search-submit" type="submit"><i class="fa fa-search"></i> <span class="screen-reader-text"><?php esc_html_e( 'Search', 'storez') ?></span></button>
    </div>
</form>
<?php endif; ?>