New Shopify Certification now available: Liquid Storefronts for Theme Developers

What does this search code do? Limit partial matches

8 0 1

Is there anyway to stop shopify searching more than I've entered? I tried to switch prefix off by changing it from last to none, but I still can't work it out... basically, we're a car parts company, when we search ERR3340, for example, we want it to show ERR3340G but not ERR3339 because that's a totally different number. I've spoke to a few developers and they don't know if it's possible.... but I can buy an external app to do it for me so it must surely?! I don't want the app as they want $400 a month to index the products we have, and that's a lot of extra fees for something that doesn't seem like it should be this hard!!! 


Look at this page but can't work it out...


This is where I changed it to 'none' - is this right?

{% assign search_category = blank %}
{% assign search_filter_string = blank %}
{%- if search.performed -%}
{% assign field_prefixes = 'product_type: tag:' | split: ' ' %}
{% for field_prefix in field_prefixes %}
{% if search.terms contains field_prefix %}
{% assign search_filter = search.terms | split: field_prefix | none %}
{% assign search_category = search_filter | remove: 'searchfilter_' %}
{% assign search_filter_string = field_prefix | append: search_filter %}
{% break %}
{% endif %}
{% endfor %}
{%- endif -%}

Replies 0 (0)