search-results
{% assign search_pagination = section.settings.pagination_limit %} {% paginate search.results by search_pagination %}
{% comment %}Check to see if sidebar should be enabled{% endcomment %} {% if section.blocks.size > 0 %} {% assign sidebar = true %} {% else %} {% assign sidebar = false %} {% endif %} {% if search.performed %} {% if search.results == empty %}
{% else %} {% if settings.search_option == 'everything' or search.results.first.price == blank %} {% if sidebar %} {% include 'sidebar' %}
{{ 'general.search.title' | t }}
{% if search.performed %} {% endif %}{{ 'general.search.no_results_html' | t: terms: search.terms }}
{% else %} {% if settings.search_option == 'everything' or search.results.first.price == blank %} {% if sidebar %} {% include 'sidebar' %}
{% else %}
{% endif %} {% for item in search.results %}
{% schema %} { "name": "Search", "class": "search-template-section", "settings": [ { "type": "select", "id": "products_per_row", "label": "Products per row", "options": [ { "value": "2", "label": "2" }, { "value": "3", "label": "3" }, { "value": "4", "label": "4" } ] }, { "type": "select", "id": "pagination_limit", "label": "Products per page", "options": [ { "value": "24", "label": "24" }, { "value": "36", "label": "36" }, { "value": "48", "label": "48" } ] }, { "type": "header", "content": "Blog results" }, { "type": "checkbox", "id": "blog_author", "label": "Show author" }, { "type": "checkbox", "id": "read_more_link", "label": "Show continue reading link for blog post excerpts", "default": true }, { "type": "checkbox", "id": "blog_date", "label": "Show date", "default": true }, { "type": "header", "content": "Sidebar" }, { "type": "paragraph", "content": "Create a sidebar by adding content blocks." }, { "type": "checkbox", "id": "toggle", "label": "Toggle sidebar content" } ], "blocks": [ { "type": "filter_by_collection", "name": "Collection list", "limit": 1 }, { "type": "filter_by_type", "name": "Type list", "limit": 1 }, { "type": "filter_by_vendor", "name": "Vendor list", "limit": 1 }, { "type": "menu", "name": "Menu", "settings": [ { "type": "link_list", "id": "custom_menu_linklist", "label": "Menu" } ] }, { "type": "text", "name": "Text", "settings": [ { "type": "text", "id": "title", "label": "Heading", "default": "Heading" }, { "type": "richtext", "id": "text", "label": "Text", "default": "
{% assign featured_image = false %} {% if item.object_type == 'article' and item.image %} {% assign featured_image = true %}
{% elsif item.featured_image %} {% assign featured_image = true %}
{% endif %} {% if sidebar %}
{% endfor %}
{% else %} {% if sidebar %} {% include 'sidebar' %}
{% else %}
{% endif %}
{{ item.title }}
{% if item.price %} {% if item.compare_at_price_max > item.price %} {{ item.compare_at_price_max | money }} {% endif %} {% if item.available %} {% if item.price_varies %} {% if item.compare_at_price_max > item.price %}
{% endif %} {{ 'products.general.from' | t }} {% endif %} {{ item.price_min | money }} {% else %} {{ item.price_min | money }} - {{ 'products.product.sold_out' | t }} {% endif %}
{% endif %} {% if item.object_type == 'article' %}
{% endif %} {% if item.excerpt %}
{% endif %} {{ 'products.general.from' | t }} {% endif %} {{ item.price_min | money }} {% else %} {{ item.price_min | money }} - {{ 'products.product.sold_out' | t }} {% endif %}
{{ item.excerpt }}
{% if section.settings.read_more_link %}
{{ 'blogs.general.continue_reading_html' | t }}
{% endif %} {% else %}{{ item.content | strip_html | truncatewords: 40 | highlight: search.terms | replace: 'Description', '' | replace: 'Specs', '' | replace: 'Shipping', '' | replace: 'Size', '' }}
{% endif %}{% endfor %}
{% else %}
{% endif %} {% endpaginate %}{% endif %} {% assign products = search.results %} {% assign products_per_row = section.settings.products_per_row %} {% include 'product-loop', sidebar: sidebar %}
{% endif %} {% endif %} {% include 'pagination' %} {% else %}
{{ 'general.search.description' | t }}
Text area can be used for special announcements or general information.
" } ] }, { "type": "page", "name": "Page", "settings": [ { "type": "page", "id": "content_page", "label": "Page" } ] } ] } {% endschema %}