How do I add the vendor name to order confirmation emails.
I’ve found some code snippets, but dont know where to insert them .
How do I add the vendor name to order confirmation emails.
I’ve found some code snippets, but dont know where to insert them .
Hi
I can’t find where to put the vendor info.
This is the code for the order confirmation email
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
</style>
</head>
<body>
<table class="body">
<tr>
<td>
<table class="header row">
<tr>
<td class="header__cell">
<center>
<table class="container">
<tr>
<td>
<table class="row">
<tr>
<td class="shop-name__cell">
{%- if shop.email_logo_url %}
<img src="{{shop.email_logo_url}}" alt="{{ shop.name }}" width="{{ shop.email_logo_width }}">
{%- else %}
<h1 class="shop-name__text">
<a href="{{shop.url}}">{{ shop.name }}</a>
</h1>
{%- endif %}
</td>
<td>
<table class="order-po-number__container">
<tr>
<td class="order-number__cell">
<span class="order-number__text">
Order {{ order_name }}
</span>
</td>
</tr>
{%- if po_number %}
<tr>
<td class="po-number__cell">
<span class="po-number__text">
PO number #{{ po_number }}
</span>
</td>
</tr>
{%- endif %}
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<table class="row content">
<tr>
<td class="content__cell">
<center>
<table class="container">
<tr>
<td>
<h2>{{ email_title }}</h2>
<p>{{ email_body }}</p>
{% assign transaction_count = transactions | size %}
{% if transaction_count > 0 %}
{% for transaction in transactions %}
{% if transaction.show_buyer_pending_payment_instructions? %}
<p> {{transaction.buyer_pending_payment_notice}} </p>
<p>
<table class="row">
<tr>
{% for instruction in transaction.buyer_pending_payment_instructions %}
<td>{{ instruction.header }}</td>
{% endfor %}
<td>Amount</td>
</tr>
<tr>
{% for instruction in transaction.buyer_pending_payment_instructions %}
<td>{{ instruction.value }}</td>
{% endfor %}
<td>{{transaction.amount | money}}</td>
</tr>
</table>
</p>
{% endif %}
{% endfor%}
{% endif %}
{% if order_status_url %}
<table class="row actions">
<tr>
<td class="empty-line"> </td>
</tr>
<tr>
<td class="actions__cell">
<table class="button main-action-cell">
<tr>
<td class="button__cell"><a href="{{ order_status_url }}" class="button__text">View your order</a></td>
</tr>
</table>
{% if shop.url %}
<table class="link secondary-action-cell">
<tr>
<td class="link__cell">or <a href="{{ shop.url }}">Visit our store</a></td>
</tr>
</table>
{% endif %}
</td>
</tr>
</table>
{% else %}
{% if shop.url %}
<table class="row actions">
<tr>
<td class="actions__cell">
<table class="button main-action-cell">
<tr>
<td class="button__cell"><a href="{{ shop.url }}" class="button__text">Visit our store</a></td>
</tr>
</table>
</td>
</tr>
</table>
{% endif %}
{% endif %}
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<table class="row section">
<tr>
<td class="section__cell">
<center>
<table class="container">
<tr>
<td>
<h3>Order summary</h3>
</td>
</tr>
</table>
<table class="container">
<tr>
<td>
{% if has_split_cart %}
<table class="row">
{% for line in subtotal_line_items %}
{% unless line.delivery_agreement %}
{% if line.groups.size == 0 %}
{% assign legacy_separator = true %}
{% comment %} Skip child add-ons since they will be rendered under the parent line item {% endcomment %}
{% unless line.nested_line_child? %}
{% assign is_parent = false %}
{% assign is_nested_line_parent = line.nested_line_parent? %}
{% if line.bundle_parent? or line.nested_line_parent? %}
{% assign is_parent = true %}
{% endif %}
{% if is_nested_line_parent %}
{% assign css_order_list_cell_nested_line_parent_class = 'order-list__parent-cell' %}
{% assign css_order_list_parent_image_cell_nested_line_parent_class = 'order-list__nested-parent-image-cell' %}
{% endif %}
<tr class="order-list__item">
<td class="order-list__item__cell {{ css_order_list_cell_nested_line_parent_class }}">
<table height="100%">
<td style="padding-bottom: 0px;">
<table height="100%">
<tr valign="top">
{% if false and is_parent %}
<td class="order-list__parent-image-cell {{ css_order_list_parent_image_cell_nested_line_parent_class }}">
{% if line.image %}
<img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% else %}
<div class="order-list__no-image-cell">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" class="order-list__no-product-image"/>
</div>
{% endif %}
</td>
{% else %}
<td class="order-list__image-cell">
{% if line.image %}
<img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% else %}
<div class="order-list__no-image-cell">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="60" height="60" class="order-list__no-product-image"/>
</div>
{% endif %}
</td>
{% endif %}
</tr>
{% if is_nested_line_parent %}
<tr height="100%">
<td style="padding: 0px;" height="100%">
<table height="100%">
<tr>
<td height="100%" class="nested-line-item-spacer-cell">
<div class="nested-line-item-spacer"></div>
</td>
<td height="100%" class="parent-vertical-line__cell">
<div class="parent-vertical-line__content"></div>
</td>
</tr>
</table>
</td>
</tr>
{% endif %}
</table>
</td>
<td class="order-list__product-description-cell">
{% if line.presentment_title %}
{% assign line_title = line.presentment_title %}
{% elsif line.title %}
{% assign line_title = line.title %}
{% else %}
{% assign line_title = line.product.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %}
{{ line.quantity }} of {{ line.quantity }}
{% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
<span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>
{% if line.variant.title != 'Default Title' and is_parent == false %}
<span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
{% elsif line.variant.title != 'Default Title' and line.nested_line_parent? %}
<span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
{% elsif line.variant.title != 'Default Title' and line.bundle_parent? and false == false %}
<span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
{% endif %}
{% if false %}
{% for child_line in line.bundle_components %}
{% if true %}
{% assign css_class = 'order-list__bundle-item' %}
{% assign css_image_class = 'order-list__image-cell' %}
{% assign css_description_class = 'order-list__product-description-cell' %}
{% else %}
{% assign css_class = 'order-list__deliverable-item_abandoned' %}
{% assign css_image_class = 'order-list__image-cell--nested-line-item' %}
{% assign css_description_class = 'order-list__product-description-cell--nested-line-item' %}
{% if false %}
{% assign css_curved_line_cell_container_class = 'curved-line-cell-container__top-spacer-cell--show-border' %}
{% assign css_hide_vertical_line_class = 'vertical-line__content--hide' %}
{% assign css_curved_line_cell_container_cell__no_padding_class = 'curved-line-cell-container__cell--no-padding' %}
{% endif %}
{% endif %}
<table height="100%">
<tr class="order-list__item">
<td class="{{ css_class }}" height="100%">
<table height="100%">
<td class="{{ css_image_class }}">
{% if child_line.image %}
<img src="{{ child_line | img_url: 'compact_cropped' }}" align="left" width="40" height="40" class="order-list__product-image small"/>
{% else %}
<div class="order-list__no-image-cell small">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="20" height="20" class="order-list__no-product-image small"/>
</div>
{% endif %}
</td>
<td class="{{ css_description_class }}">
{% if child_line.product.title %}
{% assign item_title = child_line.product.title %}
{% else %}
{% assign item_title = child_line.title %}
{% endif %}
{% assign item_display = child_line.quantity %}
<span class="order-list__item-title">{{ item_display }} × {{ item_title }}</span><br>
{% if child_line.variant.title != 'Default Title'%}
<span class="order-list__item-variant">{{ child_line.variant.title }}</span>
{% endif %}
</td>
</table>
</td>
</tr>
</table>
{% endfor %}
{% else %}
{% for group in line.groups %}
{% if group.deliverable? %}
<span class="order-list__item-variant">For: {{ group.display_title }}</span><br/>
{% else %}
<span class="order-list__item-variant">Part of: {{ group.display_title }}</span><br/>
{% endif %}
{% endfor %}
{% endif %}
{% 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 != '_' %}
<div class="order-list__item-property">
<dt>{{ property.first }}:</dt>
<dd>
{% if property.last contains '/uploads/' %}
<a href="{{ property.last }}" class="link" target="_blank">
{{ property.last | split: '/' | last }}
</a>
{% else %}
{{ property.last }}
{% endif %}
</dd>
</div>
{% endif %}
{% endfor %}
{% endif %}
{% if line.selling_plan_allocation %}
<span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</span><br/>
{% endif %}
{% if line.refunded_quantity > 0 %}
<span class="order-list__item-refunded">Refunded</span>
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != 'all' %}
<p>
<span class="order-list__item-discount-allocation">
<img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
<span>
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
</span>
</span>
</p>
{% endif %}
{% endfor %}
{% endif %}
</td>
{% if false and is_parent %}
<td class="order-list__parent-price-cell">
{% else %}
<td class="order-list__price-cell">
{% endif %}
{% if line.original_line_price != line.final_line_price %}
<del class="order-list__item-original-price">{{ line.original_line_price | money }}</del>
{% endif %}
<p class="order-list__item-price">
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% if line.unit_price_measurement %}
<div class="order-list__unit-price">
{{- line.unit_price | unit_price_with_measurement: line.unit_price_measurement -}}
</div>
{% endif %}
{% else %}
Free
{% endif %}
</p>
</td>
{% if line.nested_line_parent? %}
{% for child_line in line.nested_lines %}
{% if false %}
{% assign css_class = 'order-list__bundle-item' %}
{% assign css_image_class = 'order-list__image-cell' %}
{% assign css_description_class = 'order-list__product-description-cell' %}
{% else %}
{% assign css_class = 'order-list__deliverable-item_abandoned' %}
{% assign css_image_class = 'order-list__image-cell--nested-line-item' %}
{% assign css_description_class = 'order-list__product-description-cell--nested-line-item' %}
{% if forloop.last %}
{% assign css_curved_line_cell_container_class = 'curved-line-cell-container__top-spacer-cell--show-border' %}
{% assign css_hide_vertical_line_class = 'vertical-line__content--hide' %}
{% assign css_curved_line_cell_container_cell__no_padding_class = 'curved-line-cell-container__cell--no-padding' %}
{% endif %}
{% endif %}
<table height="100%">
<tr class="order-list__item">
<td class="{{ css_class }}" height="100%">
<table height="100%">
<td class="nested-line-item-spacer-cell"style="padding: 1px;">
<div class="nested-line-item-spacer"></div>
</td>
<td class="curved-line-cell-container" valign="top">
<div style="width: 0px;">
<table>
<tr>
<td class="{{ css_curved_line_cell_container_cell__no_padding_class }}" style="mso-padding-right-alt: 10px;">
<div class="curved-line-cell-container__top-spacer {{ css_curved_line_cell_container_class }}"></div>
</td>
</tr>
<tr>
<td class="curved-line-cell-container__curvedLine-cell">
<div class="curved-line-cell-container__curvedLine-cell__curvedLine"></div>
</td>
</tr>
</table>
</div>
</td>
<td class="vertical-line" height="100%">
<div class="vertical-line__content {{ css_hide_vertical_line_class }}"></div>
</td>
<td class="nested-line-item-spacer-cell--right">
<div class="nested-line-item-spacer"></div>
</td>
<td class="{{ css_image_class }}">
{% if child_line.image %}
<img src="{{ child_line | img_url: 'compact_cropped' }}" align="left" width="40" height="40" class="order-list__product-image small"/>
{% else %}
<div class="order-list__no-image-cell small">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="20" height="20" class="order-list__no-product-image small"/>
</div>
{% endif %}
</td>
<td class="{{ css_description_class }}">
{% if child_line.product.title %}
{% assign item_title = child_line.product.title %}
{% else %}
{% assign item_title = child_line.title %}
{% endif %}
{% assign item_display = child_line.quantity %}
<span class="order-list__item-title">{{ item_title }} × {{ item_display }}</span><br>
{% if child_line.variant.title != 'Default Title'%}
<span class="order-list__item-variant">{{ child_line.variant.title }}</span>
{% endif %}
</td>
</table>
</td>
</tr>
</table>
{% endfor %}
{% endif %}
</table>
</td>
</tr>
{% endunless %}
{% endif %}
{% endunless %}
{% endfor %}
{% for line_item_group in line_item_groups %}
{% unless line_item_group.components.first.delivery_agreement %}
{% assign legacy_separator = true %}
{% assign final_line_price = 0 %}
{% assign original_line_price = 0 %}
{% assign discount_keys_str = "" %}
{% assign parent_line_item = nil %}
{% if line_item_group.deliverable? == false %}
{% assign line_item_group_class = "order-list__item__cell" %}
{% for component in line_item_group.components %}
{% assign final_line_price = final_line_price | plus: component.final_line_price %}
{% assign original_line_price = original_line_price | plus: component.original_line_price %}
{% for da in component.discount_allocations %}
{% if da.discount_application.target_selection != 'all' %}
{% assign discount_key = da.discount_application.title | append: da.discount_application.type %}
{% assign discount_keys_str = discount_keys_str | append: discount_key | append: "," %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% if line_item_group.deliverable? %}
{% assign parent_line_item = line_item_group.parent_sales_line_item %}
{% assign final_line_price = parent_line_item.final_line_price %}
{% assign original_line_price = parent_line_item.original_line_price %}
{% assign line_item_group_class = "order-list__parent_item__cell" %}
{% assign padding_bottom_none_class = "padding-bottom-none" %}
{% endif %}
{% assign discount_keys = discount_keys_str | split: "," | uniq %}
<tr class="order-list__item">
<td class="{{ line_item_group_class }}" style="padding: 15px 0 0px 1px;">
<table height="100%">
<td class="order-list__parent-image-cell">
<table height="100%">
<tr>
<td class="{{ padding_bottom_none_class }}" valign="top">
{% if parent_line_item and parent_line_item.image %}
<img src="{{ parent_line_item | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% elsif line_item_group.image %}
<img src="{{ line_item_group | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% else %}
<div class="order-list__no-image-cell">
<img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="30" height="30" class="order-list__no-product-image"/>
</div>
{% endif %}
</td>
</tr>
{% if line_item_group.deliverable? == true %}
<tr height="100%">
<td height="100%" class="parent-vertical-line__cell">
<table height="100%" style="width: auto;">
<tr>
<td height="100%" class="nested-line-item-spacer-cell">
<div style="width: 6px;"></div>
</td>
<td height="100%" class="parent-vertical-line__cell">
<div class="parent-vertical-line__content"></div>
</td>
</tr>
</table>
</td>
</tr>
{% endif %}
</table>
</td>
<td class="order-list__product-description-cell">
<table>
<tr>
<td class="order-list__product-description-cell" colspan="2">
<span class="order-list__item-title">{{ line_item_group.display_title }} × {{ line_item_group.quantity }}</span><br/>
{% if line_item_group.variant and line_item_group.variant.title != 'Default Title' %}
<span class="order-list__item-variant">{{ line_item_group.variant.title }}</span>
{% endif %}
{% if line_item_group.deliverable? %}
{% if parent_line_item.discount_allocations %}
{% for discount_allocation in parent_line_item.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != 'all' %}
<p>
<span class="order-list__item-discount-allocation">
<img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
<span>
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
</span>
</span>
</p>
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{% for discount_key in discount_keys %}
{% assign discount_amount = 0 %}
{% for component in line_item_group.components %}
{% for da in component.discount_allocations %}
{% assign key = da.discount_application.title | append: da.discount_application.type %}
{% if da.discount_application.target_selection != 'all' and key == discount_key %}
{% assign discount_amount = discount_amount | plus: da.amount %}
{% assign discount_title = da.discount_application.title %}
{% endif %}
{% endfor %}
{% endfor %}
<p>
Hi @SDBdigital
Shopify Admin → Settings → Notifications → Order confirmation
Inside the order confirmation template, find this loop:
{% for line in line_items %}
Inside that loop (usually near the product title), add this line:
<p style="margin: 0; font-size: 14px; color: #777;">
Vendor: {{ line.product.vendor }}
</p>
Best regards,
Devcoder ![]()
I don’t know what a loop is.
also the line “{% for line in line_items %}” does not appear in the code at all
Add your code below this line of code
<span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span>
Hi
That line of code appears 4 times - do I insert the vendor code under each instance?