Shopify

■新着商品一覧をトップに表示
コレクション機能を使う

コレクションの出し方

{% for collection in collections %}
{% if collection.handle == ‘おすすめ商品’ %}
{% for product in collection.products %}

  {{ product.title }}<br>
  {{ product.url }}<br>

{% if product.featured_image == nil %}
  <figure class="product-thumbnail"><img src="noImage.jpg"></figure>
{% else %}
  <figure class="product-thumbnail"><img src="{{ product.featured_image | img_url:'300x' }}"></figure>
{% endif %}

{% endfor %}

{% endif %}
{% endfor %}

https://takblog.site/web/?p=192
■件数制御<br>
{% assign collection = collections['all'] %}
{% for product in collection.products limit:3 %}
       {{ product.title }}<br>
      {{ product.url }}<br>
    {% if product.featured_image == nil %}
      <figure class="product-thumbnail"><img src="noImage.jpg"></figure>
    {% else %}
      <figure class="product-thumbnail"><img src="{{ product.featured_image | img_url:'300x' }}"></figure>
    {% endif %} 
{% endfor %}

https://community.shopify.com/c/%E6%8A%80%E8%A1%93%E7%9A%84%E3%81%AAq-a/%E7%89%B9%E5%AE%9A%E3%81%AE%E3%82%B3%E3%83%AC%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92-%E4%BB%B6%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%9F%E3%81%84/m-p/784840

タグをセクション化する
https://skillhub.jp/blogs/326

※セクションを追加で、作ったセクションが表示されない場合は検索をかけたり画面を切り替えたり色々する

■ログインログアウト時の分岐

{%- if customer -%}
   <!– ログイン中は「ログアウト」–>
   <a href="{{ routes.account_logout_url }}">ログアウト</a>
{%- else -%}
<!– ログインしていない時は「ログイン」–>
 <a href="{{ routes.account_url }}">ログイン</a>
{%- endif -%}


■商品拡大をやめる

https://community.shopify.com/c/shopify-design/how-to-turn-off-zoom-photo-on-product-pages-in-dawn/td-p/1448547