# 商品検索後の並び替え(ソート)の追加方法について

**URL:** <https://community.shopify.com/t/topic/22488>\
**Category:** 技術的なQ＆A\
**Created:** [October 8, 2020, 5:27am UTC](https://community.shopify.com/t/topic/22488 "2020-10-08T05:27:23Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

「Warehouse」テーマのカスタマイズで、検索結果ページに商品の並び替え機能が表示されない問題が扱われた。添付スクリーンショットが状況把握の中心で、当初は検索結果にソートUI自体が見えず、その後は表示されるようになったものの、検索結果先でプルダウンが出ない状態が続いている。 

回答では、同様の挙動が再現できるため、テーマ側の仕様である可能性が高いとの見方が示された。必要であれば、テーマ制作者へフィードバックするのがよいと案内されている。 

技術的には、コレクションページでは `sort_by` を使って URL パラメータ付きで並び替えできるが、検索結果を扱う search オブジェクトには `sort_by` がない点が重要と整理された。そのため、検索結果では Liquid の `sort` フィルターで配列を並べ替える程度しか対応できない可能性がある。 

結論として、テーマ仕様とShopifyの検索オブジェクト制約が原因候補で、標準的なプルダウン対応の可否は未解決のまま。

<div class="post-metadata">

**Author:** ![Hideto](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@Hideto](https://community.shopify.com/u/Hideto)\
**Post date:** [October 8, 2020, 5:27am UTC](https://community.shopify.com/t/topic/22488/1 "2020-10-08T05:27:23Z")

</div>

現在、「Warehouse」のテーマをカスタマイズしています。

検索した検索結果に商品の並び替えが表示されません。

 ![スクリーンショット-2020-10-08-14.15.49.png](https://canada1.discourse-cdn.com/shopifyforum/original/3X/d/6/d6f98d951d9fc23fea80271de55bd346d9cef5c8.png)

 ![スクリーンショット-2020-10-08-14.16.29.png](https://canada1.discourse-cdn.com/shopifyforum/original/4X/e/d/c/edced78a4e0e89b1ab71ae10019c644e4a8d62d1.png)

どなたかご存知の方がいらっしゃいましたら、お知恵を拝借下さいますと幸いです。

---

<div class="post-metadata">

**Author:** ![junichiokamura](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/junichiokamura/32/299737_2.png) [@junichiokamura](https://community.shopify.com/u/junichiokamura)\
**Post date:** [October 12, 2020, 6:41pm UTC](https://community.shopify.com/t/topic/22488/2 "2020-10-12T18:41:49Z")

</div>

こちらでも再現しますが、おそらく仕様かと思います。

可能であればテーマ作成者にフィードバックをされるのが良いと思います。

---

<div class="post-metadata">

**Author:** ![Hideto](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@Hideto](https://community.shopify.com/u/Hideto)\
**Post date:** [October 13, 2020, 3:56pm UTC](https://community.shopify.com/t/topic/22488/3 "2020-10-13T15:56:53Z")

</div>

ご返信ありがとうございます。

表示はされるようになりましたが、検索結果先でプルダウンが表示されません。

 ![スクリーンショット 2020-10-14 0.53.12.png](https://canada1.discourse-cdn.com/shopifyforum/original/3X/4/1/4116d20947878cec37d873b91be418923c291a88.png)

 ![スクリーンショット 2020-10-14 0.55.16.png](https://canada1.discourse-cdn.com/shopifyforum/original/4X/9/2/f/92f2e6c7abb3d66eea97ee018e1d46e2b8401da7.png)

どなたかお知恵をお借りできれば幸いです。

---

<div class="post-metadata">

**Author:** ![\_osamu\_iwasaki](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/_osamu_iwasaki/32/272617_2.png) [@\_osamu\_iwasaki](https://community.shopify.com/u/_osamu_iwasaki)\
**Post date:** [October 30, 2020, 3:14am UTC](https://community.shopify.com/t/topic/22488/4 "2020-10-30T03:14:36Z")

</div>

コレクションオブジェクトの並べ替えは、  
sort\_by を使うとURLに「?sort\_by=best-selling」などの並べ替え用の引数がつきます。

[https://shopify.dev/docs/themes/liquid/reference/objects/collection#collection-sort\_by](https://shopify.dev/docs/themes/liquid/reference/objects/collection#collection-sort_by)

商品一覧にパラメーターを追加して並び替える  
[https://haniwaman.com/shopify-sort/#i-4](https://haniwaman.com/shopify-sort/#i-4)

ですが、サーチオブジェクトのほうは、sort\_by はありません。

検索結果の配列を sort フィルターで並べ替えることくらいしか出来ないと思います。

[https://shopify.dev/docs/themes/liquid/reference/filters/array-filters#sort](https://shopify.dev/docs/themes/liquid/reference/filters/array-filters#sort)

Sort the search results based on price  
[https://community.shopify.com/c/Shopify-Design/Sort-the-search-results-based-on-price/td-p/443658](https://community.shopify.com/c/Shopify-Design/Sort-the-search-results-based-on-price/td-p/443658)
