Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1191399
    keith s
    Participant

    I have added a line in my x child theme function.php file to make it search for product. It seems to return products when part number is entered without fail. What do I add to make it search description text? Addition added last week is listed below. I was thinking it would just be a line of code to the piece below.

    Please advise. Thank you.

    add_filter( ‘pre_get_posts’, ‘custom_search’ );
    function custom_search( $query ) {
    if ( $query->is_search ) {
    $query->set( ‘post_type’, array( ‘product’ ) );
    }
    return $query;
    }

    #1191534
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Regretfully, your inquiry is beyond the scope of our support. However, you may check the following resource (https://docs.woocommerce.com/document/woocommerce-product-search/).

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1191399 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>