• Hi,

    Awesome stuff. I like it a lot. I would like to replace savoy search with yours instead. I have tried by myself to change in the functions file but without result, so I turn to you. Any ideas?

    Cheers

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    ‘Savoy’ is your current WordPress theme?

    And the search is also belongs to this theme?

    Thanks.

    Thread Starter stefanjap

    (@stefanjap)

    I am using savoy theme for our shop yes. It seems the search belongs to this theme.

    Im tired ot their search and want to change to yours instead.

    Cheers

    Plugin Author ILLID

    (@mihail-barinov)

    Try to add this code to your theme functions.php file

    add_filter( 'get_search_form', 'aws_search_form' );
    add_filter( 'get_product_search_form', 'aws_search_form' );
    
    function aws_search_form( $form ) {
        return do_shortcode( '[aws_search_form]' );
    }
    Thread Starter stefanjap

    (@stefanjap)

    Maybe I should explain a little bit more. I would like to do something like the search icon, and use your search engine instead of savoy. When the icon is pressed, search field comes up. Possible to just exchange them? The search itself is working as a shortcode on any page I want, but not the menu or like savoy, an icon.

    Thank you for your time.

    Plugin Author ILLID

    (@mihail-barinov)

    Yes, I understand that you just want to change search engine.

    But have you tried to add the code above? Its must just replace search form but search icon in the header still must be there.

    Thread Starter stefanjap

    (@stefanjap)

    Ok good!
    I tried but id didnt work ??

    Plugin Author ILLID

    (@mihail-barinov)

    Try to open savoy/woocommerce/product-searchform_nm.php file,

    and replace

    <form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
        <input type="text" id="nm-shop-search-input" autocomplete="off" value="" name="s" placeholder="<?php esc_attr_e( 'Search products', 'woocommerce' ); ?>" />
        <input type="hidden" name="post_type" value="product" />
    </form>

    with

    <?php echo do_shortcode( "[aws_search_form]" ); ?>

    Thread Starter stefanjap

    (@stefanjap)

    I tried and now I can see the name [aws_search_form] on the field instead of “search for products”. So something is happening but still cant search. Seems the shortcode cant be loading somehow.

    Thread Starter stefanjap

    (@stefanjap)

    Hi again,

    It is now working perfectly! Problem was the cache, sorry for a noob mistake. Thank you so much for your help and support!

    If its working flawless later, i will support your work by buying this plungin.

    Best regards,
    Stefan

    Thread Starter stefanjap

    (@stefanjap)

    The final thing that need to be fixed is to get your search in the mobile menu.

    Thank you in advance!

    Plugin Author ILLID

    (@mihail-barinov)

    Well if you make changes in the code that I describe above that new search form also must work and in mobile devices too.

    Thread Starter stefanjap

    (@stefanjap)

    I used your code above and replaced one I found in the footer.php where the menu settings was. Now its working.

    Now when I press the search icon, I cant write anything until i actually klick on the area to write on. How to make so the i can write directly after pressing the search icon.

    Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Sorry, but for now I don’t see AWS search form on your site.
    Where can I find it?

    Thanks.

    Thread Starter stefanjap

    (@stefanjap)

    Sorry for that, I forgot to give you our url for our shop.
    https://godhemszoo.se

    Cheers

    Plugin Author ILLID

    (@mihail-barinov)

    Please open advanced-woo-search/assets/js/common.js file, find lines

    $(document).ready(function() {
    
            $(selector).each( function() {
                $(this).aws_search();
            });
    
    });

    and replace with

    $(document).ready(function() {
    
            $(selector).each( function() {
                $(this).aws_search();
            });
    
            var $searchBtn = $('#nm-shop-search-btn');
            var $searchPanel = $('#nm-shop-search');
            var $searchInput = $searchPanel.find('.aws-search-field');
            var $searchResults = $('#aws-search-result-1');
    
            $searchBtn.on('click', function() {
    
                setTimeout(function(){
                    if ( $searchPanel.hasClass('fade-in') ) {
                        $searchInput.focus();
                    } else {
                        $searchInput.val('');
                        $searchResults.html('').hide();
                    }
                }, 300);
    
            });
    
        });
Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘replace savoy search with yours’ is closed to new replies.