Сортировка продукта по марке, фильтр в выборе - Shopify - PullRequest
0 голосов
/ 10 июля 2020

У меня есть два выбора в моей коллекции в Shopify.

См. Экран моей коллекции

И код:

<div class="module gf_module-{{align_lg}} gf_module-{{align_lg}}-lg gf_module-{{align_md}}-md gf_module-{{align_sm}}-sm gf_module-{{align_xs}}-xs {{extraClass}}">
    <div class="gf_collection-toolbar-wrapper">
<div class="gf_collection-tool gf_collection-filter-wrapper">
    <select class="gf_collection-filter">  
{% assign tags = collection.all_tags %}
{% if current_tags %}
{% else %}
   {% assign current_tags = "" | split: "" %}
{% endif %}

<option value="">{{ filter_text }}</option>
{% for tag in tags %}
    {% if current_tags contains tag %}
<option value="{{ tag | handle }}" selected>{{ tag }}</option>
    {% else %}
<option value="{{ tag | handle }}">{{ tag }}</option>
    {% endif %}
{% endfor %}
    </select>
</div>


<div class="gf_collection-tool gf_product-quantity-wrapper">
    {% if {{display_quantity}} == 1 %}
{% assign quantityTemplate = '{{quantity_template}}' %}
{% assign productsCount = collection.products_count %}
       
<span class="gf_product-quantity">{{ quantityTemplate | replace: '%number%', productsCount }}</span>  
    {% endif %}
</div>

<div class="gf_collection-tool gf_sort-collection-wrapper">
    <select class="gf_sort-collection">
{% if collection.sort_by == null %}
    {% assign sort_by = collection.default_sort_by %}
{% else %}
    {% assign sort_by = collection.sort_by %}
{% endif %}

<option value="">{{ sorting_text }}</option>

{% for option in collection.sort_options %}
    {% if sort_by == option.value %}
<option value="{{ option.value }}" selected>{{ option.name }}</option>
    {% else %}
<option value="{{ option.value }}">{{ option.name }}</option>
    {% endif %}
{% endfor %}
    </select>
</div>
    </div>
</div>

I хотите заменить код из двух вариантов выбора для фильтрации моего продукта по типу продукта для выбора слева и названия бренда продукта для выбора справа.

Можно ли это сделать с жидкостью?

Спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...