HomePage Forums Themeforest Melawell – Medical Elementor WooCommerce Theme How to change wording in search field and remove categories dropdown from search

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8194
    Avatardino.hajric
    Supported

    Hi there,

    I need to change the search products text in the search field with my own text, and I don’t need the categories dropdown, can I remove it?

    I am developer, so in case there is something we need to change in code please share.

    Thanks,
    Dino

    #8199

    Please copy this custom code and paste into` the file functions.php ( child-theme):

    function melawell_product_search() {
    	if (melawell_is_woocommerce_activated()) {
    		static $index = 0;
    		$index++;
    ?>
    <div class="ajax-search">
    	<form role="search" method="get" class="woocommerce-product-search"
    		  action="<?php echo esc_url(home_url('/')); ?>">
    		<div class="melawell-search-product-form">
    			<div class="search-wrapper">
    				<input type="search"
    					   id="woocommerce-product-search-field-<?php echo isset($index) ? absint($index) : 0; ?>"
    					   class="search-field"
    					   placeholder="<?php echo esc_attr__('Search products&hellip;', 'melawell'); ?>"
    					   autocomplete="off" value="<?php echo get_search_query(); ?>" name="s"/>
    				<input type="hidden" name="post_type" value="product"/>
    			</div>
    			<button type="submit" value="<?php echo esc_attr_x('Search', 'submit button', 'melawell'); ?>">
    				<i class="melawell-icon-search"></i>
    				<span><?php echo esc_html_x('Search', 'submit button', 'melawell'); ?></span>
    			</button>
    		</div>
    	</form>
    	<div class="ajax-search-result d-none">
    		<div class="inner"></div>
    	</div>
    </div>
    <?php
    	}
    }

    Then edit “Search products…” => “Your text”

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.