简体   繁体   English

在shopify中添加价格过滤器?

[英]Add price filter in shopify?

I'm lookign a way to add a price filter in shopify . 我想看一下在shopify中添加价格过滤器的方法。 .. ..

I've found this tutorial, which works perfect for the tag and collection filter, however it doesnt say how to create the price filter ... http://docs.shopify.com/support/your-store/collections/filtering-a-collection-with-multiple-tag-drop-down#you-will-need-some-javascript 我找到了这个教程,它适用于标签和集合过滤器,但它并没有说如何创建价格过滤器... http://docs.shopify.com/support/your-store/collections/filtering-一个收集与-多标签下拉#你意志,需要,一些JavaScript的

If you have any recommendation, it will be wonderfull, 如果您有任何建议,那将是精彩的,

I should look like this: http://satterfield-pfeffer5655.myshopify.com/collections/all 我应该看起来像这样: http//satterfield-pfeffer5655.myshopify.com/collections/all

Thank you for all your time ! 谢谢你所有的时间!

It looks as though the price filter is created the same way as the others in that tutorial , using tags: 看起来价格过滤器的创建方式与该教程中的其他过滤器一样,使用标签:

Whenever you need a “shop by” drop-down on a collection page, you need to handle things with product tags. 每当您需要在收集页面上“购买”下拉菜单时,您需要处理带有产品标签的内容。

The tutorial also gives an example of a URL that filters by price using tags: 本教程还提供了一个使用标签按价格过滤的URL示例:

The URL below filters the Women collection with product tag “Dresses”, “Black” and “Between $40 and $60” . 以下网址使用产品标签“Dresses”,“Black”和“介于40美元和60美元之间 ”过滤了Women系列。

/collections/women/dresses+black+ between-40-and-60 / collections / women / dresses + black + 40-and-60

Alternatively, you could use smart collections to filter by price (so you don't have to add all those price tags to your products). 或者,您可以使用智能集合按价格进行过滤(因此您不必将所有这些价格标签添加到您的产品中)。 For example: 例如:

<ul class="clearfix filters">
  <li class="clearfix filter">
    <label>Shop by price</label>
    <select class="coll-picker">
      <option value="all">All</option>
      {% assign price_collections = 'under-100,100-120,over-120' | split: ',' %}
      {% for pc_handle in price_collections %}
        <option value="{{ pc_handle }}" {% if collection.handle == pc_handle %}selected{% endif %}>{{ collections[pc_handle].title }}</option>
      {% endfor %}
    </select>
  </li>
</ul>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM