• Resolved etaf

    (@etaf)


    I’m using your free PLUGIN on a wordpress Site with TOTAL Theme

    When i search for a SKU – using just the SKU number – IE

    A1150

    then it works fine

    BUT if I put in

    SKU:A1150

    it does not work

    I guess it needs the PRO version to fuzzy search

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Marta

    (@martadella)

    Hi etaf,

    Fuzzy search won’t help here. The solution is to remove the “SKU:” string from the search phrase before it goes to the search engine. This way, FiboSearch will search for the actual SKU, without the “SKU:” prefix. You can do that by adding the following code to your website:

    add_filter( 'dgwt/wcas/phrase', function( $phrase ) {
    $phrase = str_ireplace( 'sku:', '', $phrase );
    return $phrase;
    } );

    You have two ways to add this code to your theme:
    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the Code Snippets plugin and apply this code as a snippet.

    I hope this helps!

    Regards,
    Marta

    Thread Starter etaf

    (@etaf)

    thanks for the code

    i have looked into furhter and actually they are just using the SKU number

    BUT the search intermittently return “no items found” for items that are on the website

    It happened to me yesterday – ONCE product A958 came back OK – but then while on the phone to the guy that was having the issue it returned NO items

    then it worked again

    Been working fine for me all day today

    Maybe its an internet connection issue OR maybe a menu search option

    I have the ajax search in the footer of every page – added via the TOTAL theme

    maybe i have a conflict in the searches – been so long ago i set all this up – 2019ish

    anyway – thanks again – and if you have any suggestions always welcome

    fenori.co.uk is the website

    Search is in the footer of every page

    search is also at the bottom of the hamburger menu

    Plugin Support Marta

    (@martadella)

    Hi etaf,

    The search in the footer returns the correct result for the “A958” search phrase. However, the search in the menu is not FiboSearch and it probably can’t search by SKU. That’s why it doesn’t return anything for “A958”. Please remove the search from the menu. Instead, you can add FiboSearch to your header. This can be done with the following code:

    add_action( 'wpex_hook_header_inner', function() {
    echo do_shortcode( '[fibosearch layout="icon"]' );
    } );

    I hope this helps.

    Regards,
    Marta

    Thread Starter etaf

    (@etaf)

    i’m using a theme – TOTAL theme and also using a child theme

    so a little hesitant to add that code into “the header”

    as not sure where the right place to add into the theme itself

    fenori.co.uk

    i suspect i’m using the TOTAL theme search in the menu – I will have to resolve that

    Thread Starter etaf

    (@etaf)

    thanks , i looked into this a bit more – and on the TOTAL theme supports Fibosearch and in woocommerce theres an option to tick to replace

    which i have done

    working better now for the – only think is now the search bar entry when clicked to type into – OPENS a new window …..

    must be a settign somewhere ughh!!!!!! –

    Plugin Support Marta

    (@martadella)

    Hi etaf,

    If you’re using the mobile menu, FiboSearch will open the mobile overlay once you click the Total search bar in the menu. The solution is to replace the Total search bar with FiboSearch and disable the mobile overlay for desktops. This can be done with the following code:

    add_action( 'wp_footer', function() {
    echo '<div id="fibo-desktop">' . do_shortcode( '[fibosearch layout="classic"]' ) . '</div>';
    ?>
    <script>
    window.onload = (event) => {
    if (window.innerWidth < 998) {
    return;
    }
    let mobileMenu = document.querySelector('.mobile-menu-toggle');
    if (mobileMenu) {
    mobileMenu.onclick = function() {
    let mobileSearch = document.querySelector('.sidr-class-mobile-menu-searchform');
    let fiboSearch = document.querySelector('#fibo-desktop');
    if (mobileSearch && fiboSearch) {
    mobileSearch.replaceWith(fiboSearch);
    }
    let fiboOverlays = document.querySelectorAll('.js-dgwt-wcas-enable-mobile-form');
    fiboOverlays.forEach((fiboOverlay) => {
    fiboOverlay.remove();
    });
    };
    }
    };
    </script>
    <?php } );

    Add it to the functions.php file or use a Code Snippets plugin.

    I hope this helps!

    Regards,
    Marta

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.