Skip to content

Instantly share code, notes, and snippets.

@vitohuang
Created October 9, 2017 21:39
Show Gist options
  • Save vitohuang/e6db65d32ab2cd72230d457334908a3e to your computer and use it in GitHub Desktop.
Save vitohuang/e6db65d32ab2cd72230d457334908a3e to your computer and use it in GitHub Desktop.
<table>
<thead>
<th>{{ languages.productName }}</th>
<th>{{ languages.purchaseDate }}</th>
{% if shopSetting.extraFields %}
{% for field in shopSetting.extraFields %}
<th>{{ field.name }}</th>
{% endfor %}
{% endif %}
</thead>
<tbody>
{% for item in payload.items %}
<tr>
<td>
{% if item.product.handle %}
<a href="https://{{ shopName }}.myshopify.com/products/{{ item.product.handle }}">
<img src="{{ item.product.imageUrl }}" width="100" height="100"/>
<br/>
{{ item.product.title }}
</a>
{% else %}
{% if item.product.imageUrl %}
<img src="{{ item.product.imageUrl }}" width="100" height="100"/>
<br/>
{% endif %}
{{ item.product.title }}
{% endif %}
</td>
<td>{{ item.purchaseDate }}</td>
{% if shopSetting.extraFields %}
{% for field in shopSetting.extraFields %}
{% for f in item.extraFields %}
{% if f.name == field.name %}
<td>
{% if f.type == 'image' && f.value %}
<a href="{{ f.value }}" target="_blank">
<img width="100" height="100" src="{{ f.value }}" />
</a>
{% else %}
{{ f.value }}
{% endif %}
</td>
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment