tibewww
tibewww

Reputation: 603

Add price filter in 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,

I should look like this: http://satterfield-pfeffer5655.myshopify.com/collections/all

Thank you for all your time !

Upvotes: 1

Views: 14384

Answers (1)

Steph Sharp
Steph Sharp

Reputation: 11682

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:

The URL below filters the Women collection with product tag “Dresses”, “Black” and “Between $40 and $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>

Upvotes: 3

Related Questions