How to add order details from fulfillment page in the email confirmation

How to add order details from fulfillment page in the email confirmation

Layne2Kim
New Member
5 0 0

Hi, I am using an app (IzyRent) for booking dates, and I want to add the order details from the fulfillment page to the email confirmation that is automatically sent out when a customer places an order. Like on this example in the order details. 

Layne2Kim_0-1743057967522.png

How do I make the order confirmation email have the dates that show in the order, when it's sent out to the customer. Here's what it looks like now. Any help would be greatly appreciated. 

Layne2Kim_1-1743057983473.png

 

Replies 5 (5)

Sushant
Shopify Partner
90 2 16

@Layne2Kim , From the screenshot that you have shared, it looks like the shipping information is stored in the order line item properties. If yes, then it can be added to the order confirmation email. By default the line item attributes are present in the order confirmation email in case of a Gift card. However, if you want to display this for non-gift card orders, you will have to edit the code.

Step 1. Open the Order Confirmation template: Settings > Notifcations > Customer Notifications > Order confirmation > Edit code

Step 2. Search for 

{% 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 %}

 and replace it by

{% 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 %}

What this removal of the gift card condition is that, it will print the line item properties(if present) for every type of product.

This solution is based on the assumption that your delivery information is saved in the line item properties. Please test this once by sending a preview email to yourself before saving this change.

 

 

Any Likes and Accept as Solutions are greatly appreciated✌ Having trouble? Hire us! https://seventhtriangle.com/
Layne2Kim
New Member
5 0 0

Hi thanks for the reply, I tried to edit that code, and it didn't give me the dates, it looks like this. 

Layne2Kim_0-1743084875257.png


In the order it shows the dates it's rented, March 29-March 30th. I just want the dates to show up that show up in the order details, there is no shipping info. 

Layne2Kim_1-1743084965752.png

 

 

Layne2Kim
New Member
5 0 0

Here's a screenshot of the code I changed, in the order confirmation email. 

Layne2Kim_2-1743085150184.png

 

Sushant
Shopify Partner
90 2 16

@Layne2Kim ,
Please remove the below highlighted code lines and test.

Sushant_0-1743151955942.png

 

Please note, this solution is still based on the assumtion that your dates are stored in the product's line item properties. Please try this once and let me know if this works.

Any Likes and Accept as Solutions are greatly appreciated✌ Having trouble? Hire us! https://seventhtriangle.com/
Layne2Kim
New Member
5 0 0

@Sushant Thanks for the info, I tried  your last code edit and it gives me this error "Body html Liquid syntax error: 'endfor' is not a valid delimiter for if tags. use endif" so not sure to change. 

Layne2Kim_0-1743431250874.png