Product Search Bar Results Not Displaying Correctly

There seems to be two issues when a user does a product search from the Store Sidebar in the Resource Store (or WooCommerce Store.

Resource Store

  1. When a search is submitted in the “Search Products” search bar, the results page is goofy. It does not show the Uber Menu correctly. See screenshot.

  2. When it displays the results at the bottom, it is displaying results from posts and not from products in the store.

How can these issues be resolved? Thanks in advance!!

Hi,

I tried on my test site with the latest version of the theme but can’t replicate the issue.

Can you try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes!

As suggested, I deactivated plugins, but the issue still remained. After deactivating the plugins I refreshed the page and did a new search… still I am getting the goofy page.

Hello There,

Thanks for writing in!

1.) This is because you are using a custom template in your child theme that is already deprecated. Please relocate your _topbar.php to wp-content/themes/x-child/framework/legacy/cranium/headers/views/global/ folder. You will have to create the folder path since it does not exist in your child theme.

And another thing I noticed is that you are using this in wp_index.php

<?php

// =============================================================================
// VIEWS/RENEW/WP-INDEX.PHP
// -----------------------------------------------------------------------------
// Index page output for RENEW.
// =============================================================================

$is_filterable_index = is_home() && x_get_option( 'x_renew_filterable_index_enable' ) == '1';

?>

<?php get_header(); ?>

  <div class="x-container max width main">

    <?php //x_get_view( 'renew', '_post', 'slidere' ); ?>
    <?php echo do_shortcode('[rev_slider alias="church-home"]'); ?>

    <div class="offset cf">
      <div class="<?php x_main_content_class(); ?>" role="main">

        <?php if ( $is_filterable_index ) : ?>
          <?php x_get_view( 'renew', '_index' ); ?>
        <?php else : ?>
          <?php x_get_view( 'global', '_index' ); ?>
        <?php endif; ?>

      </div>

      <?php get_sidebar(); ?>

    </div>
  </div>

<?php get_footer(); ?>


You are trying to display <?php x_get_view( 'renew', '_index' ); ?> and there is no _index.php file in your child theme’s wp-content/themes/x-child/framework/views/renew/

2.) You search results does not include products because you have added this php code in your child theme’s functions.php file:

// add custom types to archive
function search_add_custom_types( $query ) {
  if( is_search() && ! is_admin() ) {
    $query->set( 'post_type', array(
      'post', 'essential_grid'
    ));
  return $query;
  }
}
add_filter( 'pre_get_posts', 'search_add_custom_types' );

Please remove this code block so that the product search will give you correct search results.

Thanks for the quick reply! I followed your advice from the first part of #1 and all of #2. And it resolved my issues! :grin::grin::grin:

But I did not follow you on the part I am quoting below about the _index.php for renew. I downloaded a new copy of the X theme and renew does not have _index.php file.

Here is what you said…

Please let me know what I should do.

Hi There,

Sorry for the confusion!

The _index.php file locates in this directory: x/framework/views/global/ in the parent theme.

Hope that helps and thank you for understanding.

Thanks! Everything is working good! :grin:

You’re welcome!
Thanks for letting us know that it has worked for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.