Home Forums WoodMart support forum Issue with Product Search Not Displaying Results in WoodMart Theme

Issue with Product Search Not Displaying Results in WoodMart Theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #650156

    vpetrovic6
    Participant

    I am experiencing an issue with the product search functionality in the WoodMart theme. When I search for a product (e.g., “iPhone”), the dropdown search results display the correct products. However, when I press the search icon (submit button), I am redirected to a search results page that does not display any products.

    Here’s what I have tested so far:

    The issue only occurs with the WoodMart theme; other themes display search results correctly.

    The search URL generated is: https://mywebsite.com/?s=iphone&post_type=product but it returns no results.

    If I remove &post_type=product from the URL, the search works and displays products.

    I tried adding the following function to functions.php to force WooCommerce product search:
    function fix_woodmart_product_search($query) {
    if ($query->is_search() && !is_admin()) {
    $query->set(‘post_type’, array(‘product’));
    $query->set(‘wc_query’, ‘product_query’);
    }
    }
    add_action(‘pre_get_posts’, ‘fix_woodmart_product_search’, 10);

    However, this did not solve the issue.

    AJAX search is disabled in WoodMart settings.

    There are no conflicting plugins.

    The permalink structure is set to “Post name” (/%postname%/).

    Could you please provide guidance on how to fix this issue? It seems like the theme is blocking or modifying the search query for products.

    Thank you!

    Best regards,
    VP

    #650337

    Hung Pham
    Keymaster

    Hi vpetrovic6,

    Thanks for reaching to us and appreciate your patience.

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,

    #650375

    vpetrovic6
    Participant

    Ok, thanks

    #650447

    Hung Pham
    Keymaster

    Hi vpetrovic6,

    Thanks for details.

    I see an error on your site due to insufficient memory on the server https://ibb.co/CKH9tV6h because he has a lot of widgets on the shop page.

    This problem also exists with the default Product Attribute widget when there are a lot of them and you have a lot of products on the site. In this case, we recommend increasing the server memory or reducing the number of widgets on the shop page.

    Please make a custom search page without widgets through Woodmart Layout, and in this case, everything will work. Further, you can read more about the Layout Builder here: https://xtemos.com/docs-topic/woodmart-woocommerce-layout-builder/

    Regards,

Viewing 4 posts - 1 through 4 (of 4 total)