Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #1148836

    Hi Guys,

    Good morning!
    I was looking for a solution to get solve this issue of get the search bring as results, products,sku, pages and posts.
    In the forum I found this post “Improved search for Woo Commerce” and I’ve implemented in the code, but it doesnt work for me, because it brings as result only products and SKU’s, pages and posts don’t.

    Could you please give me a help to set it up?

    Thanks in advance!

    Regards,
    Eduardo.

    #1149596

    Hey EduardoPriuli,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1152105

    Hi Victoria,

    Sure.
    Please find in the private content the credentials to access the site.
    I’m looking forward to hearing back from you.

    Thanks,

    #1153972

    Hello Victoria,

    Good Morning!

    I didn’t hear about you. Did you get any update about the issue I’m facing in?

    Im looking forward to hear from you soon.

    Thanks in advance,

    Cheers,
    Eduardo.

    #1154057

    Hi,

    Please Install he plugin called ” Search Everything ” and let us know if this shorts the issue for you.

    Best regards,
    Basilis

    #1154287

    Hi Basilis,

    I’ve tried with two different plugins, “Search Everything” and also “Ivory Search”, but it didn’t work.
    Do you have any other suggestion?

    I just wanna make the “search” brings post, pages and also products in the results.

    Looking for your reply.

    Thanks in advance.
    Eduardo.

    #1154922

    Hi there,

    Is there anyone that could help me with this issue??

    I’m looking forward to hearing from you guys.

    Thanks in advance!

    #1155369

    Hi,

    Give us a link of your web site and some keywords you tried ( where they exist as a product also ) so we can understand what is going on and how we can implement it further please.

    Best regards,
    Basilis

    #1155607

    Hi Basilis,

    Please find the requested information in the Private content area.
    I put the site link, the Product Page (woocommerce) and also regular page, I’d like the search brings both pages in the search result page.

    I’ll be looking for your assistance.

    Regards,
    Eduardo

    #1156500

    Hi,

    I tried for Bravo and here are the results
    https://www.tcr-tecora.com/en/?s=Bravo+Basic

    not sure why you say that they are not visible?

    Best regards,
    Basilis

    #1156690

    Hello Basilis,

    Good morning!
    Sorry, maybe I wasn’t clear enough explaining myself.
    The Post Title is: Search Products, Pages and Posts.
    I have pages and products with the same titles, like: BRAVO BASIC. So, I would like the search brings all results Pages, Products and Posts.
    The link for the Product information page is: https://www.tcr-tecora.com/en/outdoor-air-quality/bravo-basic/
    and the Product (woocommerce) Page is: https://www.tcr-tecora.com/en/product/bravo-basic/
    bur the Keyword is always the same: Bravo Basic.

    The problem is, the search result show me only the Product Information Page and not the Product (Woocommerce) Page.

    I hope this time get explain it better. Once again I’m sorry.

    I’ll be looking for your assistance.

    Thanks
    Eduardo.

    #1157915

    Hi Basilis,

    Good Afternoon,
    I’m still waiting for your support, how long I’ll need to wait to hear from you guys?

    I think it shouldn’t be a tough issue for you, 5 dedicated minutes could be enough to solve this issue.

    I’m looking to hearing from you soon.

    Thank you.

    #1158002

    Hi,

    Sorry for the delay. You can add the following filter in the functions.php file to make the items with the product post type searchable.

    function avf_enable_cpt_search( $query ) {
        if ( $query->is_search ) {
           $query->set( 'post_type', array( 'post', 'attachment', 'product', 'portfolio', 'page' ) );
           $query->set( 'post_status', array( 'publish', 'inherit' ) );
        }
    
       return $query;
    }
    
    add_filter( 'pre_get_posts', 'avf_enable_cpt_search' );
    

    Please make sure that the previous search plugins that you installed are deactivated before testing the changes.

    Best regards,
    Ismael

    #1161091

    Hi Ismael,

    I have tried to implement the code but it returns the following error:

    Your PHP code changes were rolled back due to an error on line 0 of file Unknown. Please fix and try saving again.
    Exception thrown without a stack frame

    I’ll be looking for your reply.

    Thanks in advance.

    #1161182

    Hi,

    Thank you for the update.

    Did you copy the code from your email? Please try to copy it directly from the forum to prevent unwanted text conversion. Let us know if it still doesn’t work then.

    Best regards,
    Ismael

    #1162563

    Hi Ismael,

    I’m sad to say it didn’t work.
    Any other idea? It shouldn’t be a big deal….

    Look to hearing from you.

    Cheers,

    #1162870

    Hi,

    Thank you for the update.

    We added the code in the functions.php file. The search is now displaying items from all available post types including products. (see private field)

    Best regards,
    Ismael

    #1162899

    Hi Ismael,

    Ok now it’s working fine! Thanks a lot!

    Regards,

    Priuli

    • This reply was modified 4 years, 11 months ago by Priuli.
    #1163122

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1405496

    long time ago – and your code here on https://kriesi.at/support/topic/search-products-pages-and-posts-enfold/#post-1158002
    i use too and posted it here – because i did not found it via search function.

    But now i got one problem – how to show the search results page as grid – if attachments are also listed. The known changes in search.php do not work with attachments – and even if i change the custom-query there too – no effort.
    I have already asked Günter – but I do not want to overuse his friendliness and accommodation. Maybe you have an idea what it could be.

    #1405696

    Hi,

    I made the following modifications to your core theme files:

    search.php (line 55):

    
    global $wp_query;
    
    						$atts = array(
    									'type'		=> 'grid',
    //									'post_type'	=> [ 'attachment' ],
    									'items'		=> get_option('posts_per_page'),
    									'columns'	=> 3,
    									'class'		=> 'avia-builder-el-no-sibling',
    									'paginate'	=> 'yes',
    									'use_main_query_pagination'	=> 'yes',
    									'wp_query'	=> $wp_query
    								);
    
    						/**
    						 * @since 4.5.5
    						 * @return array
    						 */
    						$atts = apply_filters( 'avf_post_slider_args', $atts, 'search' );
    
    						$blog = new avia_post_slider( $atts );
    //						$blog->query_entries();
    						echo '<div class="entry-content-wrapper">' . $blog->html() . '</div>';
    
    

    enfold\config-templatebuilder\avia-shortcodes\postslider\postslider.php (line 566):

    
    
    $this->entries = isset( $atts['wp_query'] ) && $atts['wp_query'] instanceof WP_Query ? $atts['wp_query'] : array();
    
    

    and to custom.css:

    
    
    .template-search .post-entry{
    clear: unset;
    }
    
    

    Can you have a look at it please.

    Best regards,
    Günter

    #1405710

    Hi,

    Solution will be in 5.6.

    Use filter ‘avf_search_result_layout’ and return ‘grid’.

    Above changes to custom.css are no longer necessary.

    Best regards,
    Günter

    #1405745

    Thank you for finding/creating a solution for this. This is a good thing for photographers and sites that display art objects (paintings, sculptures, etc.), as most search results only contain links to attachment pages (photos or other media files).

    #1406018

    Hi,
    Glad Günter could help, we will close this now since this will be added to the next version. Thank you for using and contributing to Enfold.

    Best regards,
    Mike

Viewing 24 posts - 1 through 24 (of 24 total)
  • The topic ‘Search products, pages and posts [ENFOLD]’ is closed to new replies.