Home › Forums › WoodMart support forum › Live Search
Live Search
- This topic has 9 replies, 2 voices, and was last updated 6 years, 9 months ago by Artem Temos.
-
AuthorPosts
-
March 12, 2018 at 11:05 am #45377
maherdaouddxParticipantDears,
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?March 12, 2018 at 12:34 pm #45394
Artem TemosKeymasterHi,
Sorry, what do you mean by
to change the target of the search live
?March 12, 2018 at 12:56 pm #45397
maherdaouddxParticipanttarget 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/shopMarch 12, 2018 at 1:35 pm #45410
Artem TemosKeymasterSorry, but we can’t change it since it is a part of the WooCommerce plugin functionality.
March 12, 2018 at 11:42 pm #45544
maherdaouddxParticipantDears,
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 widgetThanks
March 13, 2018 at 7:31 am #45564
Artem TemosKeymasterHi,
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
March 13, 2018 at 10:42 am #45638
maherdaouddxParticipantmany thanks for you
what is the hook for this function?
to use it on function.php of my child themeMarch 13, 2018 at 11:00 am #45644
Artem TemosKeymasterJust copy the code we sent you to the child theme and edit it.
March 13, 2018 at 12:00 pm #45655
maherdaouddxParticipantMany 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 rateMarch 13, 2018 at 12:25 pm #45666
Artem TemosKeymasterYou 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 🙂
-
AuthorPosts
- You must be logged in to create new topics. Login / Register