Home Forums WoodMart support forum Disable Product ID from Search Results

Disable Product ID from Search Results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #656301

    minhtam398
    Participant

    I hope this message finds you well.

    I am currently using the Woodmart theme for my WooCommerce store and I’ve encountered an issue related to the product search functionality.

    By default, the Woodmart search appears to return results based on multiple fields including Product ID, Title, and SKU. However, in my store, some products have IDs that are numerically identical to SKUs, which leads to confusing and inaccurate search results.

    Attachments:
    You must be logged in to view attached files.
    #656305

    minhtam398
    Participant

    What I would like to achieve:
    ✅ Search should match only against SKU and Product Title.

    ❌ Search should exclude results that match Product ID.

    #656331

    Luke Nielsen
    Keymaster

    Hello,

    Please send access to the admin panel so we can investigate that issue a dig deeper.

    I await your response.

    Kind Regards

    #656760

    minhtam398
    Participant

    I attempted to override the behavior using WordPress hooks such as woocommerce_product_query_meta_query and posts_search. While these work partially for standard WooCommerce search, they do not affect the AJAX-based search used by Woodmart, which still appears to return products based on the ID.

    Therefore, I would appreciate if you could:

    Confirm whether the default Woodmart search logic includes matching by product ID.

    Provide a clean way (e.g. hook, filter, setting, or code override) to disable ID matching while still allowing title and SKU to be searchable.

    I am using the latest version of Woodmart and WooCommerce.

    Thank you for your time and support. I look forward to your guidance on this.

    #656983

    Luke Nielsen
    Keymaster

    Hello,

    Add the code below to the child theme and recheck the issue:

    add_action('woodmart_search_by_id', '__return_false');

    Kind Regards

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