# 商品ページに関連商品リストを作成したい

**URL:** <https://community.shopify.com/t/topic/184208>\
**Category:** 技術的なQ＆A\
**Created:** [January 17, 2023, 7:19am UTC](https://community.shopify.com/t/topic/184208 "2023-01-17T07:19:35Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

ユーザーがDawnテーマでネットショップを構築中で、商品詳細ページに関連商品を表示する機能を実装したいと質問しています。

**実装したい内容:**
- 表示中の商品と同じコレクションに属する商品を5つ程度表示
- 同じタグを持つ商品の表示も検討中

**提示されたコード:**
Liquidテンプレートを使用して `product.collections` をループし、各コレクション内の商品を取得するコードを記載。ただし、現在表示中の商品自体も出力されてしまう問題があり、それを非表示にする方法を求めています。

**現在の状況:**
- コレクションの取得方法が不明
- 表示中商品の除外方法が不明
- タグベースでの商品出力方法についても情報を求めている

質問は未解決で、具体的な実装方法の回答待ちの状態です。

<div class="post-metadata">

**Author:** ![nrk](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nrk](https://community.shopify.com/u/nrk)\
**Post date:** [January 17, 2023, 7:19am UTC](https://community.shopify.com/t/topic/184208/1 "2023-01-17T07:19:35Z")

</div>

Dawnテーマにてネットショップを構築しております。

商品詳細ページにて、表示している商品と同じコレクションを取得して、取得したコレクションと同じアイテムを5つほど表示したいのですが、表示している商品と同じコレクションの取得方法がわかりません。

アプリなしで実装したいと考えておりますので、上記をご教授いただければと思います。

よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![nrk](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nrk](https://community.shopify.com/u/nrk)\
**Post date:** [January 17, 2023, 8:14am UTC](https://community.shopify.com/t/topic/184208/2 "2023-01-17T08:14:23Z")

</div>

```markup
{% for collection in product.collections %}
            {% for product in collection.products %}
              

                
                  
                  
                    

{{ product.title }}

                    
                      {{ product.price | money }}
                    
                  

                
              

            {% endfor %}
          {% endfor %}

```

上記で表示している商品のコレクションを取得、商品の出力はできたのですが、表示中の商品を非表示にしようとするとどうすれば良いのでしょうか？

---

<div class="post-metadata">

**Author:** ![nrk](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nrk](https://community.shopify.com/u/nrk)\
**Post date:** [January 17, 2023, 8:54am UTC](https://community.shopify.com/t/topic/184208/3 "2023-01-17T08:54:34Z")

</div>

また、表示中の商品と同じタグを持った商品を出力する方法等もご教授いただきたいです。
