2016-05-17 6 views
0

私の問題の解決策を探しています。私はShopifyのユニークなページに商品のコレクションを引っ張って、.liquidを使用しています。私は正しいコレクションを引き出して行に表示することができましたが、価格やタイトル、詳細などの余分な情報は表示されません。ここで私のページにコレクションを引っ張ってきたコードです。助言がありますか?Shopifyのカスタムページにコレクションをプルしましたが、画像以外の情報は表示されません

すべての情報が役立ちます!これを私のページに集中させる問題もあります。

{% assign collection = collections.aaron-wallis %} 
    {% assign products = collections.aaron-wallis.products %} 
    {% capture new_row %} 
<div class="product_row"> 
    {% endcapture %} 
    {% for product in products limit: limit %} 
     <a href="{{ product.url | within: collection }}" title="{{ product.featured_image.alt | escape }}"> 
      <img {% if settings.align_height %} 
       style="height:{{ settings.collection_height }}px" 
       {% endif %} 
       src="{{ product.featured_image|product_img_url: 'large' }}" 
       alt="{{ product.featured_image.alt | escape }}" /> 
     </a> 
    {% endfor %} 
</div> 
+0

どのように定義されていますか? '{%assign products = collection.products%}'を試してください。 – HymnZ

答えて

0

あなたはこれを使って特定のコレクションの製品をループ可能性がありますあなたが書いたコードは、画像以外の情報を表示するように想定されていないので、

{% for product in collections[yourcollectionhandle].products %} 
    {{ product.title }} 
{% endfor %} 
0

情報はありません示しています。

コードのこの部分を見てください。

{% for product in products limit: limit %} 
     <a href="{{ product.url | within: collection }}" title="{{ product.featured_image.alt | escape }}"> 
      <img {% if settings.align_height %} 
       style="height:{{ settings.collection_height }}px" 
       {% endif %} 
       src="{{ product.featured_image|product_img_url: 'large' }}" 
       alt="{{ product.featured_image.alt | escape }}" /> 
     </a> 
    {% endfor %} 

リンクされた商品画像のみを表示することになっていました。より多くのような製品名をお望みなら、価格は

{% for product in products limit: limit %} 
     <a href="{{ product.url | within: collection }}" title="{{ product.featured_image.alt | escape }}"> 
      <img {% if settings.align_height %} 
       style="height:{{ settings.collection_height }}px" 
       {% endif %} 
       src="{{ product.featured_image|product_img_url: 'large' }}" 
       alt="{{ product.featured_image.alt | escape }}" /> 
      <p class="product-title">{{ product.title }}</p> 
      <p class="product-price">{{ product.price }}</p> 
     </a> 
    {% endfor %} 
関連する問題