Hi,
I’m seeking some help with Draft Order Notification coding, the current email generated doesn’t display the original price and applied discount, it just lumps them all together and shows the overall discount.
First image is the draft email generated.
Second image is what it looks like in the cart, this is what we want to appear in the draft order email, and regular customer email.
{% capture email_title %}Complete your purchase{% endcapture %}
{% capture email_body %}
{% if item_count > 1 %}
These items will be reserved for you until {{ reserve_inventory_until | date: format: 'default' }}.
{% else %}
This item will be reserved for you until {{ reserve_inventory_until | date: format: 'default' }}.
{% endif %}
{% endcapture %}
<table>
<table>
<table>
{%- if po_number %}
{%- endif %}
<table>
<tr>
<td>
{%- if shop.email_logo_url %}
{%- else %}
#
{{ shop.name }}
{%- endif %}
</td>
<td>
</td>
</tr>
<tr>
<td>
Invoice {{ name }}
</td>
</tr>
<tr>
<td>
PO number #{{ po_number }}
</td>
</tr>
</table>
</table>
</table>
<table>
<table>
## {{ email_title }}
{% if custom_message != blank %}
{{ custom_message }}
{% elsif reserve_inventory_until %}
{{ email_body }}
{% endif %}
<table>
<tr>
<td>
</td>
</tr>
<table>
<tr>
<td>
Complete your purchase
</td>
</tr>
</table>
{% if shop.url %}
<table>
<tr>
<td>
or Visit our store
</td>
</tr>
</table>
{% endif %}
</table>
</table>
</table>
<table>
<table>
<tr>
<td>
### Order summary
</td>
</tr>
</table>
<table>
{% for line in subtotal_line_items %}
{% endfor %}
<table>
<table>
<td>
{% if line.image %}
{% endif %}
</td>
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{{ line_title }} × {{ line_display }}
{% if line.variant.title != 'Default Title' %}
{{ line.variant.title }}
{% endif %}
{% for group in line.groups %}
Part of: {{ group.display_title }}
{% endfor %}
{% if line.gift_card and line.properties["__shopify_send_gift_card_to_recipient"] %}
{% for property in line.properties %}
{% assign property_first_char = property.first | slice: 0 %}
{% if property.last != blank and property_first_char != '_' %}
<dt>{{ property.first }}:</dt>
<dd>
{% if property.last contains '/uploads/' %}
{{ property.last | split: '/' | last }}
{% else %}
{{ property.last }}
{% endif %}
</dd>
{% endif %}
{% endfor %}
{% endif %}
{% if line.selling_plan_allocation %}
{{ line.selling_plan_allocation.selling_plan.name }}
{% endif %}
{% if order.cancelled %}
Cancelled
{% elsif line.refunded_quantity > 0 %}
Refunded
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != 'all' %}
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
{% if line.original_line_price != line.final_line_price %}
<del>{{ line.original_line_price | money }}</del>
{% endif %}
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
</table>
</table>
<table>
<td>
</td>
{% assign order_discount_count = 0 %}
{% assign total_order_discount_amount = 0 %}
{% assign has_shipping_discount = false %}
{% for discount_application in discount_applications %}
{% if discount_application.target_selection == 'all' and discount_application.target_type == 'line_item' %}
{% assign order_discount_count = order_discount_count | plus: 1 %}
{% assign total_order_discount_amount = total_order_discount_amount | plus: discount_application.total_allocated_amount %}
{% endif %}
{% if discount_application.target_type == 'shipping_line' %}
{% assign has_shipping_discount = true %}
{% assign shipping_discount = discount_application.title %}
{% assign shipping_amount = discount_application.total_allocated_amount %}
{% endif %}
{% endfor %}
{% if order_discount_count > 0 %}
{% if order_discount_count == 1 %}
{% endif %}
{% if order_discount_count > 1 %}
{% endif %}
{% for discount_application in discount_applications %}
{% if discount_application.target_selection == 'all' and discount_application.target_type != 'shipping_line' %}
{% endif %}
{% endfor %}
{% endif %}
{% if delivery_method == 'pick-up' %}
{% else %}
{% if has_shipping_discount %}
{% else %}
{% endif %}
{% endif %}
{% if total_duties %}
{% endif %}
{% if total_tip and total_tip > 0 %}
{% endif %}
<table>
<tr>
<td>
Subtotal
</td>
<td>
**{{ subtotal_price | plus: total_order_discount_amount | money }}**
</td>
</tr>
<tr>
<td>
Order Discount
</td>
<td>
**-{{ total_order_discount_amount | money }}**
</td>
</tr>
<tr>
<td>
Order Discounts
</td>
<td>
**-{{ total_order_discount_amount | money }}**
</td>
</tr>
<tr>
<td>
{{ discount_application.title }} (-{{ discount_application.total_allocated_amount | money }})
</td>
</tr>
<tr>
<td>
Pickup
</td>
<td>
**{{ shipping_price | money }}**
</td>
</tr>
<tr>
<td>
Shipping
</td>
<td>
**Free**
</td>
</tr>
<tr>
<td>
{{ shipping_discount }} (-{{ shipping_amount | money }})
</td>
</tr>
<tr>
<td>
Shipping
</td>
<td>
**{{ shipping_price | money }}**
</td>
</tr>
<tr>
<td>
Duties
</td>
<td>
**{{ total_duties | money }}**
</td>
</tr>
<tr>
<td>
Estimated taxes
</td>
<td>
**{{ tax_price | money }}**
</td>
</tr>
<tr>
<td>
Tip
</td>
<td>
**{{ total_tip | money }}**
</td>
</tr>
</table>
{% assign transaction_size = 0 %}
{% assign transaction_amount = 0 %}
{% for transaction in transactions %}
{% if transaction.status == "success" %}
{% unless transaction.kind == "authorization" or transaction.kind == "void" %}
{% assign transaction_size = transaction_size | plus: 1 %}
{% assign transaction_amount = transaction_amount | plus: transaction.amount %}
{% endunless %}
{% endif %}
{% endfor %}
{% if payment_terms and payment_terms.automatic_capture_at_fulfillment == false or b2b?%}
{% assign due_at_date = payment_terms.next_payment.due_at | date: "%b %d, %Y" %}
{% else %}
{% endif %}
<table>
<tr>
<td>
Total paid today
</td>
<td>
**{{ transaction_amount | money_with_currency }}**
</td>
</tr>
<tr>
<td>
Total due {{ due_at_date }}
</td>
<td>
**{{ payment_terms.next_payment.amount_due | money_with_currency }}**
</td>
</tr>
<tr>
<td>
Total
</td>
<td>
**{{ total_price | money_with_currency }}**
</td>
</tr>
</table>
{% if total_discounts > 0 %}
You saved {{ total_discounts | money }}
{% endif %}
{% unless payment_terms %}
{% if transaction_size > 1 or transaction_amount < total_price %}
{% for transaction in transactions %}
{% if transaction.status == "success" and transaction.kind == "capture" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
{% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (ending in {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
{% else %}
{% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
{% endif %}
{% endif %}
{% if transaction.kind == 'refund' %}
{% if transaction.payment_details.credit_card_company %}
{% assign refund_method_title = transaction.payment_details.credit_card_company %}
{% else %}
{% assign refund_method_title = transaction.gateway %}
{% endif %}
{% endif %}
{% endfor %}
<table>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
{{transaction_name}}
</td>
<td>
**{{ transaction.amount | money }}**
</td>
</tr>
Refund
<small>{{ refund_method_title | capitalize }}</small>
**- {{ transaction.amount | money }}**
</table>
{% endif %}
{% endunless %}
</table>
</table>
</table>
{% if shipping_address or billing_address or shipping_method or company_location %}
<table>
<table>
<tr>
<td>
### Customer information
</td>
</tr>
</table>
<table>
{% if shipping_address %}
{% endif %}
{% if billing_address %}
{% endif %}
<table>
<tr>
<td>
#### Shipping address
{{ shipping_address | format_address }}
</td>
<td>
#### Billing address
{{ billing_address | format_address }}
</td>
</tr>
</table>
{% if shipping_method or company_location %}
{% if company_location %}
{% endif %}
{% if shipping_method %}
{% endif %}
<table>
<tr>
<td>
#### Location
{{ company_location.name }}
</td>
<td>
#### Shipping method
{% if local_pickup %}
Local pickup - {{ shipping_method.title }}
{% if local_pickup_address %}
{{ local_pickup_address | format_address }}
{% endif %}
{% else %}
{{ shipping_method.title }}
{{ shipping_method.price | money }}
{% endif %}
</td>
<td>
</td>
</tr>
</table>
{% endif %}
</table>
</table>
{% endif %}
<table>
<table>
<tr>
<td>
If you have any questions, reply to this email or contact us at [{{ shop.email }}](mailto:{{ shop.email }})
</td>
</tr>
</table>
</table>
</table>

