在shopify中添加价格过滤器? [英] Add price filter in shopify?
问题描述
我正在寻找一种在shopify中添加价格过滤器的方法...
I'm lookign a way to add a price filter in 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
如果您有任何建议,那将是很棒的事情,
If you have any recommendation, it will be wonderfull,
我应该看起来像这样: http://satterfield-pfeffer5655.myshopify.com/collections/全部
I should look like this: http://satterfield-pfeffer5655.myshopify.com/collections/all
感谢您的光临!
推荐答案
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.
本教程还提供了一个使用标签按价格过滤的URL的示例:
The tutorial also gives an example of a URL that filters by price using tags:
下面的URL过滤产品标签为连衣裙",黑色"和价格在40到60美元之间"的Women系列.
The URL below filters the Women collection with product tag "Dresses", "Black" and "Between $40 and $60".
/collections/women/dresses + black + 介于40--60之间
/collections/women/dresses+black+between-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>
这篇关于在shopify中添加价格过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!