# Add search file to enable the Quote function in the front store

1. From the Shopify admin page, choose the **Online Store** folder > **Themes**
2. In **Themes** > choose the **More actions** button > **Edit code**&#x20;

![](https://help.samita.io/wp-content/uploads/2024/12/2024-12-25_15-59-1024x511.png)

&#x20;     3\. On the code page, click on **“Add a new template”** > choose Template type: **search** > **liquid** > Fill in the file name as: **rfq**

<figure><img src="/files/mba4SlUFPEo5SuL0hr14" alt=""><figcaption></figcaption></figure>

&#x20;     4\. Set **Done**.&#x20;

&#x20;     5\. Add the below codes to the file:

```
{%- layout none -%}
{%- if search.terms contains 'handles:' -%}
[
  {%- assign params = canonical_url | url_decode | split: "?" | last | split: "&" -%}
  {%- assign handles = '' -%}
  {%- for str in params -%}
    {%- assign str_split = str | split: "=" -%}
    {%- if str_split.first == 'q' -%}
      {%- assign handles = str_split.last | remove_first: "handles:" -%}
    {%- endif -%}
  {%- endfor -%}
  {%- if handles != '' -%}
    {%- assign handles = handles | split: "|" -%}
    {%- for handle in handles limit:20 -%}
      {%- assign product = all_products[handle] -%}
      {%- unless forloop.first -%},{%- endunless -%}
      {%- if product.id != '' -%}
        {
          "available": {{product.available}},
          "id": {{ product.id }},
          "handle": "{{ product.handle }}",
          "options": {{ product.options | json }},
          "variants": {{ product.variants | json }},
          "price": {{ product.price }},
          "tags": {{ product.tags | json }},
          "title": {{ product.title | json }},
          "type": {{ product.type | json }},
          "url": "{{ product.url }}",
          "vendor": {{ product.vendor | json }},
          "featured_image": "{{ product.featured_image.src | image_url }}",
          "images": {{ product.images | json }},
          "collection": {{ product.collections | map: 'id' | json }}
        }
      {%- else -%}
        null
      {%- endif -%}
    {%- endfor -%}
  {%- endif -%}
]
{%- else -%}
[
  {%- assign q = search.terms | downcase -%}
  {%- assign first = true -%}
  {%- for product in search.results -%}
    {%- assign matched = false -%}
    {%- assign title = product.title | downcase -%}

    {%- if title contains q -%}
      {%- assign matched = true -%}
    {%- endif -%}

    {%- for variant in product.variants -%}
      {%- assign sku = variant.sku | downcase -%}
      {%- if sku contains q -%}
        {%- assign matched = true -%}
      {%- endif -%}
    {%- endfor -%}

    {%- if matched -%}
      {%- unless first -%},{%- endunless -%}
      {%- assign first = false -%}
      {
        "available": {{product.available}},
        "id": {{ product.id }},
        "handle": "{{ product.handle }}",
        "options": {{ product.options | json }},
        "variants": {{ product.variants | json }},
        "price": {{ product.price }},
        "tags": {{ product.tags | json }},
        "title": {{ product.title | json }},
        "type": {{ product.type | json }},
        "url": "{{ product.url }}",
        "vendor": {{ product.vendor | json }},
        "featured_image": "{{ product.featured_image.src | image_url }}",
        "images": {{ product.images | json }},
        "collection": {{ product.collections | map: 'id' | json }}
      }
    {%- endif -%}
  {%- endfor -%}
]
{%- endif -%}
```

<figure><img src="/files/5OK2bdXL19YDXEtg6NAf" alt=""><figcaption></figcaption></figure>

6\. Click **Save** to finish creating this new file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.samita.io/sa-request-a-quote/general/add-search-file-to-enable-the-quote-function-in-the-front-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
