You can use the order_item.color_names variable to list the colors of a product 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 a list of colors for a product:
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
Replace the code in red above with the code in red below, as follows:
<table>
<tr>
<th>Product</th>
<th>Color</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.color_names }}
</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="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>
Comments
0 comments
Please sign in to leave a comment.