• Resolved maestrosombrita

    (@maestrosombrita)


    Hi,

    I’m doing a page at WordPress with WooCommerce . I want to show the searches of posts and products at only one page.

    The search for my wordpress redirect to search.php and the WooCommerce to archive-page.

    Do it exists the option of sending the product search to search.php?

    Best regards !!

Viewing 1 replies (of 1 total)
  • Thread Starter maestrosombrita

    (@maestrosombrita)

    Ok, fixed add it following code:

    `function woo_template_search($template) {
    global $wp_query;

    $post_type = get_query_var(‘post_type’);

    if( isset($_GET[‘s’]) && $post_type == ‘product’ ) {
    return locate_template(‘search.php’);
    }

    return $template;
    }
    add_filter(‘template_include’, ‘woo_template_search’);

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce – Search Page’ is closed to new replies.