使用数据过滤器按标签对产品进行分类?

时间:2014-10-28 00:09:23

标签: javascript jquery html shopify liquid

我将MixItUp添加到Shopify商店。 https://mixitup.kunkalabs.com/

如何使用数据过滤器按标签对产品进行分类?

{% for collection in collections %}
<div class="productwrapper">

<div class="controls">
<a class="logo" href="/"></a> 

  <button class="filter" data-filter="all">Alle Produkte</button>
  <button class="filter" data-filter=".mappen">Mappen</button>
  <button class="filter" data-filter=".ordner">Ordner</button>



  <button class="sort" data-sort="myorder:asc">Beliebtheit</button>
  <button class="sort" data-sort="myorder:desc">A-Z</button>
</div>

<div id="Container" class="container">
{% for product in collection.products limit: settings.pagination_limit %}
{% include 'product-loop' with collection.handle %}
{% endfor %}  


</div>
<div class="gap"></div>
<div class="gap"></div>
</div>  

{% endfor %} 

我的Shopify商店:

http://gloria22x.myshopify.com/

谢谢,Alex

1 个答案:

答案 0 :(得分:0)

只需包含产品的正确类名:

// These will show when .mappen is selected
<div class="mappen">
    // mappen category product
</div>
<div class="mappen">
    // mappen category product
</div>
<div class="mappen">
    // mappen category product
</div>


// these will show when .ordner is selected
<div class="ordner">
   // Ordner category product
</div>
<div class="ordner">
   // Ordner category product
</div>
<div class="ordner">
   // Ordner category product
</div>