Configuring Order Confirmation Email Templates For Multiple Shipping Address Orders
When using Giftship’s multiple shipping address tool, edits need to be made to your Order Confirmation email template to account for this alternate shipping method. These edits will ensure that both single and multiple address checkouts are covered. There are two options for configuration.
Option 1
The simplest way to configure your Order Confirmation system is to follow these steps:
> Copy and paste our pre-made template.
*** WARNING ***
By following the instructions below, you will overwrite any customizations you have made to your Order Confirmation template. If you have customized your template, you will need to incorporate your customizations into the below. We cannot support any third party customizations that are needed.
- Copy / paste the pre-built order confirmation email template code at the below url:
https://github.com/GistApps/giftship-email-template/blob/main/order-confirmation.liquid - Go to Settings -> Notifications -> Order Confirmation, and replace the contents of the order confirmation template.
- Click Save
Option 2
Adjust your pre-existing Order Confirmation template with manual edits.
- Go to Settings –> Notifications –> Order Confirmation.
- At the very top of your file, insert the following code before everything else. Take note of the instructions in the commented out areas of the below code to add additional capabilities, such as original product images and line item properties display.
{% comment %}
START: Giftship multi-address order modifications
{% endcomment %}
{%-liquid
assign ms_order = false
for tag in order.tags
if tag == "ms_order"
assign ms_order = true
endif
endfor
-%}
{% if ms_order %}
{%- assign new_non_parent_line_items = null | sort -%}
{%- for line in non_parent_line_items -%}
{% assign overridden_image = line.image %}
{% comment %}
Uncomment this block to use the original product variant images instead of the placeholders added in the multi-address process.
If you do this, you will need to also modify the image line that is a child of each non_parent_line_items to look as follows:
<!-- Original <img src="{{ line.image | img_url: 'compact_cropped' }}" ... /> -->
<!-- Modified <img src="{{ line.image.src }}" ... /> -->
{%- assign overridden_image = line.properties._gs_image | default: false -%}
{% if overridden_image %}
{% assign overridden_image = null | default: src: overridden_image %}
{% endif %}
{% endcomment %}
{% if line.variant.title == "Tax" %}
{% assign tax_price = line.final_line_price %}
{% continue %}
{% endif %}
{% if line.variant.title == "Shipping" %}
{% assign shipping_price = line.final_line_price %}
{% continue %}
{% endif %}
{% assign item_json = null | default: key: line.key, groups: line.groups, title: line.title, quantity: line.quantity, original_line_price: line.original_line_price, final_line_price: line.final_line_price, image: overridden_image, delivery_agreement: line.delivery_agreement, nested_line_child: line.nested_line_child, nested_line_parent: line.nested_line_parent, bundle_parent: line.bundle_parent, presentment_title: line.presentment_title, product: line.product, variant: line.variant, bundle_components: line.bundle_components, properties: line.properties, gift_card: line.gift_card, selling_plan_allocation: line.selling_plan_allocation, refunded_quantity: line.refunded_quantity, discount_allocations: line.discount_allocations, unit_price_measurement: line.unit_price_measurement, unit_price: line.unit_price, nested_lines: line.nested_lines %}
{% assign temp_single_object_array = item_json | sort %}
{%- assign new_non_parent_line_items = new_non_parent_line_items | concat: temp_single_object_array -%}
{%- endfor -%}
{% assign non_parent_line_items = new_non_parent_line_items %}
{% endif %}
{% comment %}
If you would like to show the shipping address for each line in multi-address orders,
please find the following line that is a child of non_parent_line_items:
<span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>
Then, add the following code block directly below it:
{% for p in line.properties %}
{% unless p.first.first == "_" %}
<span>{{ p.first }}</span>: <span>{{ p.last }}</span><br/>
{% endunless %}
{% endfor %}
Leave this comment block intact to help you find it again in the future.
{% endcomment %}
{% comment %}
END: Giftship multi-address order modifications
{% endcomment %}
Wrap any part of the template you do not want displayed on the initial multiple address email in the following. (For example, the product loop):
{% if ms_order == false %}
<!-- Content to hide in initial multiple shipping address email -->
{% endif %}
Wrap any part of the template you do want displayed on the initial multiple address email in the following (eg. A notice letting customers know they will receive more emails for each of their orders):
{% if ms_order == true %}
<!-- Content to show in initial multiple shipping address email -->
{% endif %}
Click Save.
Optionally Disable Notifications for Follow up Orders:
> Disable Notifications for follow-up orders.
Go to Apps -> Giftship -> Ship to Multiple Addresses -> and turn on the option to “Disable Notifications for follow-up Orders”. This will ensure that when your customer places an order going to multiple addresses, they will only receive one confirmation email, rather than an email per shipment.