{% comment %} 購入履歴数分ループ {% endcomment %}
{% for order in orders %}
{% comment %} 注文内のアイテムごとのループ {% endcomment %}
{% for item in order.order_items %}
{% if order.subs_order.human_state_name == "有効" %}
{% comment %} 定期ステータスが「有効」の商品の場合の処理 {% endcomment %}
{% else %}
{% comment %} 定期ステータスが「有効以外」の商品の場合の処理 {% endcomment %}
{% endif %}
{% if item.product.state == "active" %}
{% comment %} 商品が「販売中」の場合の処理 {% endcomment %}
{% else %}
{% comment %} 商品が「販売中以外」の場合の処理 {% endcomment %}
{% endif %}
{% if item.product.human_state_name == "表示" %}
{% comment %} 商品が「表示」ステータスの場合の処理 {% endcomment %}
{% else %}
{% comment %} 商品が「表示以外」のステータスの場合の処理 {% endcomment %}
{% endif %}
{% endfor %}
{% comment %} /注文内のアイテムごとのループ {% endcomment %}
{% endfor %}
{% comment %} /購入履歴数分ループ {% endcomment %}
確認・参考サイト