The default Order Template only shows the combined blank item and decoration price of a product for each line item.
If you want to show a breakdown of the combined price into separate blank product and decoration prices, you can use the item.decoration_unit_price and item.decoration_price variables.
item.decoration_unit_price shows the decoration price for a single product in a line item.
item.decoration_price shows the total decoration price for a line item.
To show the blank product price for a single product in a line item, use the following code:
item.currency_unit_price | minus:item.decoration_unit_price
To show the total blank product price for a line item, use the following code:
item.currency_full_price | minus:item.decoration_price
(Note, the total blank produce price includes tax if taxes are applicable).
Custom Code Example
Here is an example of how you can modify the default Order Template to show the blank product unit price, decoration unit price, blank product total price and decoration total price:
Default Code
Code to be modified highlighted in red:
<table class="hundred">
<thead>
<tr>
<th>Product</th>
<th>Color</th>
<th>Size / Qty</th>
<th class="text_right">Unit Price</th>
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
<th class="text_right">Discount</th>
<th class="text_right">Disc Unit Price</th>
{% endif%}
{% if order.has_taxes_against_items %}
<th class="text_right">Tax</th>
{% endif %}
{% endif %}
<th class="text_right">Qty</th>
<th class="text_right">Total</th>
</tr>
</thead>
<tbody>
{% assign colspan = 5 %}
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
{% assign colspan = colspan | plus:2 %}
{% endif%}
{% if order.has_taxes_against_items %}
{% assign colspan = colspan | plus:1 %}
{% endif %}
{% endif %}
{% assign row_count = 1 %}
{% for item in order.main_items %}
<tr>
<td class="text_left" {% unless item.has_sizes_or_colors? %} colspan="3" {% endunless %}>
{{ row_count }}.
{% if (item.supplier_product) and (item.is_not_freeform?) %}
{{ item.supplier_product.product_code }} -
{% endif %}
{{ item.product_name }}
{% if item.product_based? %}
<br />
{% else %}
{% if item.has_extra_options? %} : {% endif %}
{% endif %}
{{ item.extra_options}}
</td>
{% if item.has_sizes_or_colors? %}
{% if (item.is_freeform?) %}
<td class="text_left">{{ item.free_form_color }}</td>
{% else %}
<td class="text_left">{{ item.color_names }}</td>
{% endif %}
{% if item.free_form_size %}
<td class="text_left">{{ item.free_form_size }}</td>
{% else %}
<td class="text_left">{{ item.sizes }}</td>
{% endif %}
{% endif %}
<td class="text_right">{{ item.currency_unit_price | simple_price_format }}</td>
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
<td class="text_right">
{{ item.discount_percent }}%
</td>
<td class="text_right">
{{ item.currency_disc_unit_price | simple_price_format }}
</td>
{% endif %}
{% if order.has_taxes_against_items %}
<td class="text_right">{{ item.unit_tax | simple_price_format }}</td>
{% endif %}
{% endif %}
<td class="text_right">{{ item.qty }}</td>
<td class="text_right qty">{{ item.currency_full_price | simple_price_format }}</td>
</tr>
{% assign row_count = row_count | plus:1 %}
{% endfor %}
</tbody>
<tfoot>
<tr class="total">
<td colspan="{{colspan}}" class="text_right">Subtotal</td>
<td colspan="2" class="text_right">{{ order.main_item_price | simple_price_format }}</td>
</tr>
</tfoot>
</table>
Custom Code
Modified code highlighted in red:
<table class="hundred">
<thead>
<tr>
<th>Product</th>
<th>Color</th>
<th>Size / Qty</th>
<th class="text_right">Blank Product Unit Price</th>
<th class="text_right">Decoration Unit Price</th>
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
<th class="text_right">Discount</th>
<th class="text_right">Disc Unit Price</th>
{% endif%}
{% if order.has_taxes_against_items %}
<th class="text_right">Unit Tax</th>
{% endif %}
{% endif %}
<th class="text_right">Qty</th>
<th class="text_right">Blank Product Total</th>
<th class="text_right">Decoration Total</th>
<th class="text_right">Total</th>
</tr>
</thead>
<tbody>
{% assign colspan = 8 %}
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
{% assign colspan = colspan | plus:2 %}
{% endif %}
{% if order.has_taxes_against_items %}
{% assign colspan = colspan | plus:1 %}
{% endif %}
{% endif %}
{% assign row_count = 1 %}
{% for item in order.main_items %}
<tr>
<td class="text_left" {% unless item.has_sizes_or_colors? %} colspan="3" {% endunless %}>
{{ row_count }}.
{% if (item.supplier_product) and (item.is_not_freeform?) %}
{{ item.supplier_product.product_code }} -
{% endif %}
{{ item.product_name }}
{% if item.product_based? %}
<br />
{% else %}
{% if item.has_extra_options? %} : {% endif %}
{% endif %}
{{ item.extra_options }}
</td>
{% if item.has_sizes_or_colors? %}
{% if (item.is_freeform?) %}
<td class="text_left">{{ item.free_form_color }}</td>
{% else %}
<td class="text_left">{{ item.color_names }}</td>
{% endif %}
{% if item.free_form_size %}
<td class="text_left">{{ item.free_form_size }}</td>
{% else %}
<td class="text_left">{{ item.sizes }}</td>
{% endif %}
{% endif %}
<td class="text_right">{{ item.currency_unit_price | minus:item.decoration_unit_price | simple_price_format }}</td>
<td class="text_right">{{ item.decoration_unit_price | simple_price_format }}</td>
{% if order.use_extra_line_item_columns %}
{% if order.has_a_discount %}
<td class="text_right">
{{ item.discount_percent }}%
</td>
<td class="text_right">
{{ item.currency_disc_unit_price | simple_price_format }}
</td>
{% endif %}
{% if order.has_taxes_against_items %}
<td class="text_right">{{ item.unit_tax | simple_price_format }}</td>
{% endif %}
{% endif %}
<td class="text_right">{{ item.qty }}</td>
<td class="text_right qty">{{ item.currency_full_price | minus:item.decoration_price | simple_price_format }}</td>
<td class="text_right qty">{{ item.decoration_price | simple_price_format }}</td>
<td class="text_right qty">{{ item.currency_full_price | simple_price_format }}</td>
</tr>
{% assign row_count = row_count | plus:1 %}
{% endfor %}
</tbody>
<tfoot>
<tr class="total">
<td colspan="{{colspan}}" class="text_right">Subtotal</td>
<td colspan="2" class="text_right">{{ order.main_item_price | simple_price_format }}</td>
</tr>
</tfoot>
</table>
Comments
0 comments
Please sign in to leave a comment.