Multi search - CrystalCommerce Liquid Documentation for Designers

Multi search

The multi search page is used for advanced search/deck building searches to find multiple cards with a single query.

Additional Variables Available

products
All of the returned product drops.
multi_search_results
An array of MultiSearchResultDrop drops that respond to name and results.
query
The actual query used to do the search. Has been HTML escaped.
bad_searches
Products that could not be found.

Used in Routes

  • /products/multi_search
  • /buylist/multi_search

File: multi_search.liquid

Default Liquid Template

<div id="framed">
<h1 class="pagetitle">{{ "catalog.multi_search.title" | trans }}</h1>
{% unless query %}
<b>{{ "catalog.multi_search.what_is_deckbuilder" | trans }}</b>
<p>
{{ "catalog.multi_search.description" | trans }}
</p>

<table align="center">
  <tr >

    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "1" }}</b>
      <br />
      Forest<br>
      Mox Emerald<br>
      Birds of Paradise<br>
      Wrath of God<br>

      Fact or Fiction<br>
      etc...<br>
    </td>
    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "2" }}</b>
      <br />
      12 Forest<br>
      1 Mox Emerald<br>
      4 Birds of Paradise<br>
      2 Wrath of God<br>
      3 Fact or Fiction<br>
      etc...<br>
    </td>
    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "3" }}</b>
      <br />
      12x Forest<br>
      1x Mox Emerald<br>
      4x Birds of Paradise<br>
      2x Wrath of God<br>
      3x Fact or Fiction<br>
      etc...<br>
    </td>
  </tr>
</table>

<p>
  <i>{{ "catalog.multi_search.instructions" | trans }}</i>
</p>
{% endunless %}

<form action="{{ site.multi_search_path }}" method="POST">
  {{ token_tag }}
  <p><textarea id="multisearch_query" rows="16" cols="39" name="query">{{ query }}</textarea></p>

  <p><input type="submit" name="submit" value="{{ "buttons.continue" | trans }}" /></p>
</form>

{% if query %}
<h1 class="pagetitle">Multisearch results</h1>

<div class="products">
  {% if multi_search_results.size > 0 %}
    <table border="0" class="invisible-table" width="100%">
    {% for search in multi_search_results %}
      <tr class="header_row">
        <th colspan=2>
          <h3>{{ search.results_count }} results for "{{ search.name }}"</h3>
        </th>
      </tr>
      {% include 'product' with search.results %}
    {% endfor %}
    </table>
  {% else %}
    Your search returned no results.
  {% endif %}
</div>
{% endif %}
</div>

Default Mobile Liquid Template

<div id="framed">
<h1 class="pagetitle">{{ "catalog.multi_search.title" | trans }}</h1>
{% unless query %}
<b>{{ "catalog.multi_search.what_is_deckbuilder" | trans }}</b>
<p>
{{ "catalog.multi_search.description" | trans }}
</p>

<table align="center">
  <tr >

    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "1" }}</b>
      <br />
      Forest<br>
      Mox Emerald<br>
      Birds of Paradise<br>
      Wrath of God<br>

      Fact or Fiction<br>
      etc...<br>
    </td>
    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "2" }}</b>
      <br />
      12 Forest<br>
      1 Mox Emerald<br>
      4 Birds of Paradise<br>
      2 Wrath of God<br>
      3 Fact or Fiction<br>
      etc...<br>
    </td>
    <td valign="top">
      <b>{{ "catalog.multi_search.format_n" | trans: "n", "3" }}</b>
      <br />
      12x Forest<br>
      1x Mox Emerald<br>
      4x Birds of Paradise<br>
      2x Wrath of God<br>
      3x Fact or Fiction<br>
      etc...<br>
    </td>
  </tr>
</table>

<p>
  <i>{{ "catalog.multi_search.instructions" | trans }}</i>
</p>
{% endunless %}

<form action="{{ site.multi_search_path }}" method="POST">
  {{ token_tag }}
  <p><textarea id="multisearch_query" rows="16" cols="39" name="query">{{ query }}</textarea></p>

  <p><input type="submit" name="submit" value="{{ "buttons.continue" | trans }}" /></p>
</form>

{% if query %}
<h1 class="pagetitle">Multisearch results</h1>

<div class="products">
  {% if multi_search_results.size > 0 %}
    <table border="0" class="invisible-table" width="100%">
    {% for search in multi_search_results %}
      <tr class="header_row">
        <th colspan=2>
          <h3>{{ search.results_count }} results for "{{ search.name }}"</h3>
        </th>
      </tr>
      {% include 'product' with search.results %}
    {% endfor %}
    </table>
  {% else %}
    Your search returned no results.
  {% endif %}
</div>
{% endif %}
</div>

Drops Supported