You can use the item.all_views variable to show all product views in the Order Template.
Here is an example of how you can modify the default Order Template to show all product views (including blank and decorated views).
Default Code
{% for item in order.main_items %}
<div class="image_row" style="display:block;page-break-inside:avoid;">
<h2>
{% if (item.supplier_product) and (item.is_not_freeform?) %}
{{ item.supplier_product.product_code }} -
{% endif %}
{{ item.product_name }}
</h2>
{% if (item.is_freeform?) or (item.is_asi?) %}
{% if item.has_extra_options? %}
<p>{{ item.extra_options}}</p>
{% endif %}
{% endif %}
<ul class="image">
{% for view in item.views %}
<li>
<label>{{ view.name }}</label>
<img src="{{ view.image_url_300}}" alt="[]" />
</li>
{% endfor %}
{% if (item.is_asi?) %}
<li>
<img src="/manage/asi/image/{{ item.asi_image }}?size=normal" width="300px" alt="[]" />
</li>
{% endif %}
Custom Code
Replace the default code shown above with the code in red as follows:
{% for item in order.main_items %}
<div class="image_row" style="display:block;page-break-inside:avoid;">
<h2>
{% if (item.supplier_product) and (item.is_not_freeform?) %}
{{ item.supplier_product.product_code }} -
{% endif %}
{{ item.product_name }}
</h2>
{% if (item.is_freeform?) or (item.is_asi?) %}
{% if item.has_extra_options? %}
<p>{{ item.extra_options}}</p>
{% endif %}
{% endif %}
<ul class="image">
{% for view in item.all_views %}
<li>
<label>{{ view.name }}</label>
<img src="{{ view.image_url_300}}" alt="[]" />
</li>
{% endfor %}
{% if (item.is_asi?) %}
<li>
<img src="/manage/asi/image/{{ item.asi_image }}?size=normal" width="300px" alt="[]" />
</li>
{% endif %}
Comments
0 comments
Please sign in to leave a comment.