Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #651129

    Hello,

    I am using icon theme with woocommerce. The search results page looks really bad. I just want the search results pages to look like all the other pages displayed under the different product categories, thumbnails in 3 columns with the price. Currently the search results page displays the products as huge photos with the date it was published as if it was a blog post and it also displays the product info.

    How can I change this?

    Thanks!

    #651160

    Prasant Rai
    Moderator

    Hello Tim,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Thanks.

    #651486

    you won’t be able to see the site without logging in to wordpress as it is in “coming soon” mode. please let me know how to provide you details to enter wordpress.

    Thanks
    Tim

    #651508

    Nico
    Moderator

    Hi There,

    You could send us your detials in private reply to insure that our staff and you could see the reply.

    Thanks.

    #672801

    Hello,

    Sorry for the delay.

    You can see the site here: http://sparringstore.com.ar/

    It is live now so no need to login yet.

    #672972

    Zeshan
    Member

    Hi there,

    Thanks for updating the thread!

    By default search results page display content in single column and expand featured images 100% of the container’s width. However, you can add following CSS code under Custom > CSS in the Customizer to show images in their actual size:

    .search-results .entry-wrap {
        text-align: center;
    }
    
    .search-results .entry-wrap .entry-content {
        text-align: left;
    }
    
    .search-results .entry-featured {
        display: inline-block;
    }
    
    .search-results .entry-thumb img {
        min-width: 0;
    }
    

    Thank you!

    #673280

    hello, I have put this css into the customizer and nothing happens. Th search results are still in one column like big blog posts.

    #673685

    Nabeel A
    Moderator

    Hi again,

    Can you please provide us the link of your search result page so we can take a look?

    Thanks!

    #673736

    here is a search page result: http://sparringstore.com.ar/?s=guantes

    #673846

    Rad
    Moderator

    Hi there,

    Blog search is only applicable for page, posts, portfolio and any post type that isn’t using any special templates. And Woocommerce uses their own standard templates that are not applicable for standard search result. Even if you succeed, you’ll still see mixed layout from both post templates and woocommerce templates.

    Some uses special woocommerce extension or custom code to implement search since they don’t wan’t to mess with wordpress’s standard search. In short, it’s not possible to display a product list (that uses <ul></ul> for columns and grid) along with normal posts (that uses <div></div>).

    Thus, you can only do is set search result for blog only, or set search result for product only. And you can’t mix both.

    Follow this,

    1. Add this code at your child theme’s functions.php

    
    function searchfilter($query) {
        if ($query->is_search && !is_admin() ) {
            $query->set('post_type',array('product'));
        }
    return $query;
    }
    add_filter('pre_get_posts','searchfilter');
    
    function woocommerce_search_class( $classes ) {
    
    	if ( is_search() ) {
    		$classes[] = 'woocommerce';
    	}
    	return $classes;
    
    }
    
    add_filter( 'body_class', 'woocommerce_search_class' );
    

    2. Copy this file /wp-content/themes/x/woocommerce.php to your child theme and rename it into search.php

    Like, /wp-content/themes/x-child/search.php

    3. Upload it.

    That will work, but lacking with design since woocommerce has no dedicated template for search results.

    Thanks.

    #674286

    Hello,

    I don’t want to mix blog searches with product searches, I want to set search for products so they display in the layout like the rest of my pages.

    I mentioned blog posts because the search results were displaying products as if they were blog posts.

    I just want the search results pages to look like all the other pages displayed under the different product categories, thumbnails in 3 columns with the price.

    I am not sure how this isn’t possible as I have been on many different woocommerce websites where the search results display

    Thank you!

    #674550

    Rad
    Moderator

    Hi there,

    Those other site uses custom searches dedicated for woocommerce. WordPress alone has only one search feature, and it’s only applicable for blog. WordPress does not come with advance or special search for different post types since there is no way to predict what will be the template and output of the search. Hence it’s user responsibility to add their own advance search. The primary goal for X theme is to follow wordpress standard. Though, I’ll add this as feature request.

    You can follow the above procedure, but that will replace your default blog search in place for product search. You’ll need another dedicated search functionality if you wish to have a separate product search, and through custom development.

    Thanks for understanding.