Home Forums WoodMart support forum Search Not Working for Short Part Numbers

Search Not Working for Short Part Numbers

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

    charliedesignerman
    Participant

    Hello,

    I’m wondering if there is a way to adjust the search functionality on our website to allow searches that start with only two characters or two numbers.

    We have several products with short part numbers that are only two digits. For example, one of our backup alarms has the part number 60, but the current search won’t return results for searches shorter than your minimum character limit. This makes it difficult for customers to find products by part number.

    Could you please let us know if this limitation can be adjusted, or if there are any plugins or search tools you would recommend that support short (two-character or two-number) searches?

    Thanks so much for your help

    #706484

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this.

    add_filter( 'woodmart_ajax_search_symbols_count', function (){
    	return 2;
    } );

    Best Regards,

    #706599

    charliedesignerman
    Participant

    When I search for part number 60 on our site, the results return multiple products that contain “60” in their part numbers, and the exact product I’m looking for does not appear first.

    Ideally, I would like part number 60 to be prioritized and shown first in the search results, specifically this product:
    https://staging2.warninglightsinc.com/product/backup-alarm-die-cast-60/

    Is there a way to adjust the search behavior so that exact SKU or part number matches are shown first? Or would adding a specific search filter (such as prioritizing SKU over partial matches) help produce cleaner and more accurate results?

    Thanks so much for your help — I really appreciate it.

    #706605

    charliedesignerman
    Participant

    Additionally, when I type the part number 60 and press the Return / Enter key, the search results do not display properly and instead show the message:
    “No products were found matching your selection.”

    #706678

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    The two-character limit you mentioned applies only to the AJAX live search results — this can be adjusted using the snippet you added.

    Regarding showing exact matches first (for example, prioritizing SKU or part number), there is no option in the theme settings to do this. Implementing that behavior would require custom development, which is beyond the scope of our standard support policy.

    Best Regards,

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