You can use the order_item.predecorated_product.category_name variable to show the name of the category a decorated product belongs to in the Site-made-a-sale Email Template.
Here is an example of how you can modify the default Site-made-a-sale Email Template to show the name of the category a decorated product belongs to:
Default Code
Code to be modified highlighted in red:
<table>
<tr>
<th>Product</th>
<th>Options</th>
<th width="30">Quantity</th>
<th width="20"></th>
<th width="50" class="total">Price</th>
<th width="20"></th>
<th width="60" class="total">Total</th>
</tr>
{% for order_item in order.order_items %}
<tr>
<td >
{{ order_item.product_name}}
</td>
<td >
{{ order_item.get_options }}
</td>
<td >
{{ order_item.qty }}
</td>
<td>x</td>
<td class="total">
{{ order_item.currency_unit_price | format_currency }}
</td>
<td>=</td>
<td class="total">
{{ order_item.currency_price | format_currency}}
</td>
</tr>
{% endfor %}
<tr class="cost">
<td colspan="6">
Shipping Cost
</td>
<td class="total">
{{ order.currency_shipping_total | format_currency }}
</td>
</tr>
{% if order.currency_total_tax > 0 %}
<tr class="cost">
<td colspan="6">
Tax ({{ order.tax_list }})
</td>
<td class="total">
{{ order.currency_total_tax | format_currency }}
</td>
</tr>
{% endif %}
{% if order.uses_coupon? %}
<tr class="cost">
<td colspan="5">Coupon Discount ({{ order.coupon.name }}: {{ order.coupon.code }})</td>
<td>-</td>
<td class="total">
{{ order.currency_coupon_discount | format_currency }}
</td>
</tr>
{% endif %}
{% if order.uses_gift_certificate? %}
<tr class="cost">
<td colspan="5">Pay by Gift Certificate</td>
<td>-</td>
<td class="total">
{{ order.currency_certificate_total | format_currency }}
</td>
</tr>
{% endif %}
<tr class="final">
<td colspan="6">Total</td>
<td class="total"><span id="cart_total">{{ order.currency_final_billable_total | format_currency }}</span>
</td>
</tr>
</table>
Custom Code
Add/replace the code in red to the default code shown above as follows:
<table>
<tr>
<th>Product</th>
{% for order_item in order.order_items %}
{% if order_item.is_predecorated_product? %}
<th>Product Category</th>
{% endif %}
{% endfor %}
<th>Options</th>
<th width="30">Quantity</th>
<th width="20"></th>
<th width="50" class="total">Price</th>
<th width="20"></th>
<th width="60" class="total">Total</th>
</tr>
{% for order_item in order.order_items %}
<tr>
<td >
{{ order_item.product_name}}
</td>
{% if order_item.is_predecorated_product? %}
<td >
{{ order_item.predecorated_product.category_name}}
</td>
{% endif %}
<td >
{{ order_item.get_options }}
</td>
<td >
{{ order_item.qty }}
</td>
<td>x</td>
<td class="total">
{{ order_item.currency_unit_price | format_currency }}
</td>
<td>=</td>
<td class="total">
{{ order_item.currency_price | format_currency}}
</td>
</tr>
{% endfor %}
<tr class="cost">
<td colspan="7">
Shipping Cost
</td>
<td class="total">
{{ order.currency_shipping_total | format_currency }}
</td>
</tr>
{% if order.currency_total_tax > 0 %}
<tr class="cost">
<td colspan="7">
Tax ({{ order.tax_list }})
</td>
<td class="total">
{{ order.currency_total_tax | format_currency }}
</td>
</tr>
{% endif %}
{% if order.uses_coupon? %}
<tr class="cost">
<td colspan="6">Coupon Discount ({{ order.coupon.name }}: {{ order.coupon.code }})</td>
<td>-</td>
<td class="total">
{{ order.currency_coupon_discount | format_currency }}
</td>
</tr>
{% endif %}
{% if order.uses_gift_certificate? %}
<tr class="cost">
<td colspan="6">Pay by Gift Certificate</td>
<td>-</td>
<td class="total">
{{ order.currency_certificate_total | format_currency }}
</td>
</tr>
{% endif %}
<tr class="final">
<td colspan="7">Total</td>
<td class="total"><span id="cart_total">{{ order.currency_final_billable_total | format_currency }}</span>
</td>
</tr>
</table>
Result
Still have questions? In your DecoNetwork Admin, use the Universal Search box in the top bar to find more related help guides. Need more help? Click the icon next to the search box to open the help menu and submit a support ticket. Our Client Services team is ready to assist!
Comments
0 comments
Please sign in to leave a comment.