Search product on Quotes page

Step 1: Enable the option in the Settings

Step 2: Add a liquid file into your theme

Select a theme > Edit code > Create a new file quote-search.liquid in Sections folder.

And insert liquid code below into quote-search.liquid

{%- if predictive_search.performed -%}
{
"results_count": {{ predictive_search.resources.products.size }},
"products": [
	{%- for product in predictive_search.resources.products -%}
    {%- unless forloop.first -%},{%- endunless -%}
	{%- if product.id != '' -%}
	{
		"available": {{ product.available | json }},
		"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 }}",
		"collections": {{ product.collections | map: 'id' | json }}
	}
	{%- endif -%}
	{%- endfor -%}
]
}
{%- else -%}
  { "results_count": 0, "products": [] }
{%- endif -%}

Check result on the quote list page

Last updated