Difference between revisions of "Shopify Liquid Examples"

From the Directed Edge Developer Base
Jump to: navigation, search
(Created page with "== Basic Example (Textual output) == This first example demonstrates iterating through different recommendation types (<tt>groups</tt>) and listing a maximum of five recommended ...")
(No difference)

Revision as of 17:43, 10 October 2013

Basic Example (Textual output)

This first example demonstrates iterating through different recommendation types (groups) and listing a maximum of five recommended products per group:

{% for group in groups %}
<h3>{{group.label}}</h3>
<ul>
  {% if group.bundle %}
  <li><a href="{{bundle.buy_link}}">{{bundle.text}}</a></li>
  {% else %}
  {% for product in group.products limit:5%}
  <li>
    <a href="{{product.url}}">{{product.title}}</a>
    for {{product.price | money}}
  </li>
  {% endfor %}
  {% endif %}
</ul>
{% endfor %}