Forums Forums Search & Filter Pro Plugin doesn't work properly when there are no results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #10452

    Good day,

    I’ve been using your plugin on a site we’re developing to sell photos: http://flex.gelderlander.nl/regiobeeld/

    The plugin seems to work fine when it can find results (though the string saying how many products are displayed isn’t updated).

    However, when it can’t find any results, say when you fill in a load of garble for a title, it doesn’t seem to display a notification that nothing was found. It just lists the entire content of our product database.

    Is there a WooCommerce template I should be using instead of archive-product.php?

    The jQuery selector I’ve used for the results container is ‘ul.products’.

    Anonymous
    #10453

    It seems to work quite a bit better when I use the jQuery selector ‘#main’. However, when searching for product tags (I’ve mapped ‘Fotografen’ to tags) or product categories (again, I’ve mapped ‘Edities’ to categories — this is going to be a service for a Dutch local newspaper, we’re intending on selling photos made by our freelance photographers), the entered query doesn’t display. Is there an easy fix for this?

    Kind regards,
    Wouter Spaak

    Ross Moderator
    #10490

    Hey Wouter

    Do you have a link I could look at?

    In a regular template there would normally be a message when no products/results are found – for example (taken from http://codex.wordpress.org/The_Loop):

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <!-- do stuff -->
    <?php endwhile; else : ?>
    	<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>

    So really it sounds like how your template is handling the case when there are no search results.

    Thanks

    Anonymous
    #10492

    It turns out I hooked the results to the wrong DOM Element. When I used #main as my jquery selector, it worked perfectly.

    I also found an easy way to get all search terms in the header:

    ` <?
    function return_search_terms($page_title) {
    if(is_search()) {
    $getText = $_GET;
    $searchString = ”;
    $searchString .= ‘Zoekresultaten: “‘;
    foreach($getText as $key => $value) {
    $searchString .= $value;
    if(end($getText) !== $value) {
    $searchString .= ‘, ‘;
    }
    }
    $searchString .= ‘”‘;
    return $searchString;
    } else {
    return $page_title;
    }
    }

    add_filter(‘woocommerce_page_title’, ‘return_search_terms’);
    ?>

    Ross Moderator
    #10511

    Thanks for the info and glad you’re up and running 🙂

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