Home Forums WoodMart support forum Live Search

Live Search

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #45377

    maherdaouddx
    Participant

    Dears,

    I would like to change the target of the search live
    from : https://sparejo.com
    to : https://sparejo.com/shop
    How I can do that?

    #45394

    Artem Temos
    Keymaster

    Hi,

    Sorry, what do you mean by to change the target of the search live?

    #45397

    maherdaouddx
    Participant

    target attribute of search form, If you check this attribute it will equal to the domain of the site.
    I just want to change it to https://sparejo.com/shop

    #45410

    Artem Temos
    Keymaster

    Sorry, but we can’t change it since it is a part of the WooCommerce plugin functionality.

    #45544

    maherdaouddx
    Participant

    Dears,

    I just want to change WOODMART AJAX Search widget, I am sure it does not extended from WooCommerce
    because I use this hook to override it add_filter( ‘get_product_search_form’ , ‘woo_custom_product_searchform’ );
    but nothing happend
    I want to know what is the hook or the template for WOODMART AJAX Search widget

    Thanks

    #45564

    Artem Temos
    Keymaster

    Hi,

    OK, try to edit the file inc/template-tags.php and customize this function.

    function woodmart_search_form( $args = array() ) {
    
    	$args = wp_parse_args( $args, array(
    		'ajax' => woodmart_get_opt( 'search_ajax' ),
    		'post_type' => woodmart_get_opt('search_post_type'),
    		'show_categories' => false,
    		'type' => 'form',
    		'thumbnail' => true,
    		'price' => true,
    		'count' => 20
    	) ); 
    
    	extract( $args ); 
    
    	$class = '';
    	$data  = '';
    
    	if( $show_categories ) {
    		$class .= ' has-categories-dropdown';
    	} 
    
    	$ajax_args = array(
    		'thumbnail' => $thumbnail,
    		'price' => $price,
    		'post_type' => $post_type,
    		'count' => $count
    	);
    
    	if( $ajax ) {
    		$class .= ' woodmart-ajax-search';
    		foreach ($ajax_args as $key => $value) {
    			$data .= ' data-' . $key . '="' . $value . '"';
    		}
    	}
    
    	switch ( $post_type ) {
    		case 'product':
    			$placeholder = esc_attr_x( 'Search for products', 'submit button', 'woodmart' );
    			$description = esc_html__( 'Start typing to see products you are looking for.', 'woodmart' );
    		break;
    
    		case 'portfolio':
    			$placeholder = esc_attr_x( 'Search for projects', 'submit button', 'woodmart' );
    			$description = esc_html__( 'Start typing to see projects you are looking for.', 'woodmart' );
    		break;
    	
    		default:
    			$placeholder = esc_attr_x( 'Search for posts', 'submit button', 'woodmart' );
    			$description = esc_html__( 'Start typing to see posts you are looking for.', 'woodmart' );
    		break;
    	}
    
    	?>
    		<div class="woodmart-search-<?php echo esc_attr( $type ); ?>">
    			<?php if ( $type == 'full-screen' ): ?>
    				<span class="woodmart-close-search"><?php esc_html_e('close', 'woodmart'); ?></span>
    			<?php endif ?>
    			<form role="search" method="get" class="searchform <?php echo esc_attr( $class ); ?>" action="<?php echo esc_url( home_url( '/' ) ); ?>" <?php echo ( $data ); ?>>
    				<input type="text" class="s" placeholder="<?php echo ($placeholder); ?>" value="<?php echo get_search_query(); ?>" name="s" />
    				<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
    				<?php if( $show_categories && $post_type == 'product' ) woodmart_show_categories_dropdown(); ?>
    				<button type="submit" class="searchsubmit"><?php echo esc_attr_x( 'Search', 'submit button', 'woodmart' ); ?></button>
    			</form>
    			<?php if ( $type == 'full-screen' ): ?>
    				<div class="search-info-text"><span><?php echo ($description); ?></span></div>
    			<?php endif ?>
    			<?php if ( $ajax ): ?>
    				<div class="search-results-wrapper"><div class="woodmart-scroll"><div class="woodmart-search-results woodmart-scroll-content"></div></div><div class="woodmart-search-loader"></div></div>
    			<?php endif ?>
    		</div>
    	<?php
    }

    Or you can copy it to the functions.php file in the child theme to prevent losing changes after the update.

    Regards

    #45638

    maherdaouddx
    Participant

    many thanks for you
    what is the hook for this function?
    to use it on function.php of my child theme

    #45644

    Artem Temos
    Keymaster

    Just copy the code we sent you to the child theme and edit it.

    #45655

    maherdaouddx
    Participant

    Many thanks
    You are the best support I have work with ever
    I love you man
    you are very smart
    close it with 5 star of rate

    #45666

    Artem Temos
    Keymaster

    You are welcome, we are always happy to help you, write us when you have any difficulties or issues with our theme.

    And we would be glad if you will rate our theme with 5 stars on Theme Forest in case you are satisfied with our theme and customer service http://themeforest.net/downloads

    Thank you in advance 🙂

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