• Resolved Jason Wong

    (@eljkmw)


    I read one of your reviewers, Piet Bos (@senlin), who pointed out that your plugin can integrated with Relevanssi. I like to know how this can be achieved.

    At this moment, my purchased theme has a built-in Ajax search form that only searches products in WooCommerce. With Relevanssi, the search can be extended beyond products. I’ve activated it before and it works. However, with your plugin, it can be far better than the existing search form of the theme.

    I look forward to your reply. Thank you in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think it’s fully automatic, you shouldn’t need to do anything. I can’t even find any settings for the plugin, it just works.

    Thread Starter Jason Wong

    (@eljkmw)

    Noted with thanks, Mikko.
    Awaiting a response and some suggestions from Jonathan Christopher (@jchristopher).

    The following is the theme’s searchform.php

    
    <?php
    /**
     * The template for displaying search forms in leetheme
     *
     * @package leetheme
     */
    
    $search_param = array(
        'name'  => 'post_type',
        'value' => 'product'
    );
    
    $_id = rand();
    ?>
    
    <div class="search-wrapper lt-ajaxsearchform-container <?php echo $_id;?>_container">
        <form method="get" class="lt-ajaxsearchform" action="<?php echo esc_url(home_url('/')) ?>">
            <div class="search-control-group control-group">
                <label class="sr-only screen-reader-text">
                    <?php esc_html_e('Search here', 'altotheme'); ?>
                </label>
                <input id="lt-input-<?php echo esc_attr($_id);?>" type="text" class="search-field search-input live-search-input" value="<?php echo get_search_query();?>" name="s" placeholder="<?php esc_html_e('Search here', 'altotheme'); ?>" />
                <input type="submit" name="page" value="<?php esc_html_e('search', 'altotheme'); ?>" style="display: none" />
                <input type="hidden" class="search-param" name="<?php echo $search_param['name'];?>" value="<?php echo $search_param['value'];?>" />
            </div>
        </form>
    </div>
    

    This form integrates with other Ajax functions within the theme, which I’ll let to forgo entirely. It’ll be best to replace them with SearchWP Live Ajax Search + Relevanssi

    Cheers (^_^)

    Thread Starter Jason Wong

    (@eljkmw)

    I played around with the source code of the theme’s searchform.php. Eventually, I managed to bypass the theme’s very own Product Search feature, and have it integrate to SearchWP Live Ajax Search + Relevanssi, while still utilising some of the theme’s CSS settings for the search form.

    And, my question is how do I get Relevanssi to search for WooCommerce’s product name, tags, description text, SKU, etc.? Some help will be greatly appreciated.

    Thank you.

    Thread Starter Jason Wong

    (@eljkmw)

    It’s alright. I found that it’s to do with the Relevanssi search options, than of SearchWP Live Ajax Search.

    Since I want to particularly search for SKUs, in Relevanssi Search Options I added “_sku” (without the quotes) into Custom fields to index:. This will instruct Relevanssi to include custom fields to index.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to integrate with Relevanssi ..?’ is closed to new replies.