AgPerry's picture
Add files using upload-large-folder tool
366cc97 verified
Raw History Blame Contribute Delete
1.95 kB
{% macro tile(p) %}
<div class="tile" data-id="PLI" data-index="{{ p.listingIndex }}">
{% if p.badge %}
<div class="tile__badge" data-id="productBadge">
<img src="/static/assets/brand/gearhead-top-pick.svg" alt="{{ p.badge }}" height="26">
</div>
{% else %}<div class="tile__badge--empty"></div>{% endif %}
<a class="tile__imagelink" href="{{ p.slug }}">
<div class="tile__image">
<img data-id="image" src="{{ (default_color(p).image if default_color(p) else p.mainImage) or p.mainImage }}"
alt="{{ p.title }}" loading="lazy" width="300" height="300">
</div>
</a>
<div class="tile__swatches">
{% for c in p.colors[:5] %}
<a class="tile__swatch{% if loop.first %} is-selected{% endif %}" data-id="colorTile"
href="{{ p.slug }}?color={{ c.name | urlencode }}" title="{{ c.name }}">
<img src="{{ c.thumb or c.swatch }}" alt="{{ c.name }}" loading="lazy" width="35" height="35">
</a>
{% endfor %}
{% if p.colors | length > 5 %}<span class="tile__more">+{{ p.colors | length - 5 }}</span>{% endif %}
</div>
<p class="tile__brand" data-id="brandName">{{ p.brand }}</p>
<h2 class="tile__title" data-id="title"><a href="{{ p.slug }}">{{ p.title }}</a></h2>
{% if p.colors %}<p class="tile__colors" data-id="colorsCount">{{ p.colors | length }} color{{ '' if p.colors | length == 1 else 's' }}</p>{% endif %}
<div class="tile__price">
<span data-id="price">{{ price_label(p) }}</span>
{% if list_price_label(p) %}<span class="was">{{ list_price_label(p) }}</span>{% endif %}
{% if discount_label(p) %}<span class="tile__sale" data-id="salePrice">{{ discount_label(p) }}</span>{% endif %}
</div>
{% if p.reviews.count %}
<div class="tile__rating">
<span class="stars" data-id="reviewRating" aria-hidden="true">{{ stars(p.reviews.average) }}</span>
<span data-id="reviewCount">({{ p.reviews.count }})</span>
</div>
{% endif %}
</div>
{% endmacro %}