Inserting Expected Order Arrival Date in Order Email Notifications

sodnokjapan
New Member
3 0 0

Hi Shopify Community,

I am currently trying to figure out a way to put the expected arrival date of the order fulfillment email notification.

Because we use only one courier service, we know what our expected arrival date of the fulfilled orders will be based on the province code.

So if the province code is (JP-01 and JP-47), the arrival date of item will be 3 days adding onto the day of the fulfillment.

Next province zone will be 2 days adding onto the day of the fulfillment and the last province zone will be 1 day.

My question is:

a. will this work? I'm not sure if I'm using the "or" element correctly and the fulfillment.updated_at code is done correctly. 

b. is there a more cleaner way to make this code?

I'm self teaching myself how to use liquid, and have limited knowledge, so any type of insight would greatly be appreciated!

Because my shop is live and running, I wanted to check my work before i plug it into my notifications.

Thanks everyone for taking a look at this thread.

 

 

{% if shipping_address.province_code = ‘JP-01’ or ‘JP-47’ %}

Delivery Expected Date:
{% assign seconds = 3 | times: 24 | times: 60 | times: 60 %}
{{ ‘fullfilment.updated_at’ | date: "%s" | plus: seconds | date: "%Y-%m-%d" }}

{% endif %}

{% if shipping_address.province_code = ‘JP-02’ or ‘JP-03’ or ‘JP-04’ or ‘JP-05’ or ‘JP-06’ or ‘JP-07’ or ‘JP-08’ or ‘JP-09’ or ‘JP-40’ or ‘JP-41’ or ‘JP-42’ or ‘JP-43’ or ‘JP-44’ or ‘JP-45’ or ‘JP-46’ %}

Delivery Expected Date:
{% assign seconds = 2 | times: 24 | times: 60 | times: 60 %}
{{ ‘fullfilment.updated_at’ | date: "%s" | plus: seconds | date: "%Y-%m-%d" }}

{% endif %}

{% if shipping_address.province_code = ‘JP-10’ or ‘JP-11’ or ‘JP-12’ or ‘JP-13’ or ‘JP-14’ or ‘JP-15’ or ‘JP-16’ or ‘JP-17’ or ‘JP-18’ or ‘JP-19’ or ‘JP-20’ or ‘JP-21’ or ‘JP-22’ or ‘JP-23’ or ‘JP-24’ or ‘JP-25’ or ‘JP-26’ or ‘JP-27’ or ‘JP-28’ or ‘JP-29’ or ‘JP-30’ or ‘JP-31’ or ‘JP-32’ or ‘JP-33’ or ‘JP-34’ or ‘JP-35’ or ‘JP-36’ or ‘JP-37’ or ‘JP-38’ or ‘JP-39’ %}

Delivery Expected Date:
{% assign seconds = 1 | times: 24 | times: 60 | times: 60 %}
{{ ‘fullfilment.updated_at’ | date: "%s" | plus: seconds | date: "%Y-%m-%d" }}

{% endif %}

 

 

0 Likes
sodnokjapan
New Member
3 0 0

So after some research, my assumption was i needed to change the province code into arrays in zones.

But its still not showing up and cant figure it out...

{% assign shipping_zone_3 = ‘JP-01, JP-47' | remove: ' ' | split: ',' %}
{% assign shipping_zone_2 = ‘JP-02, JP-03, JP-04, JP-05, JP-06, JP-07, JP-08, JP-09, JP-40, JP-41, JP-42, JP-43, JP-44, JP-45, JP-46' | remove: ' ' | split: ',' %}
{% assign shipping_zone_1 = ‘JP-10, JP-11, JP-12, JP-13, JP-14, JP-15, JP-16, JP-17, JP-18, JP-19, JP-20, JP-21, JP-22, JP-23, JP-24, JP-25, JP-26, JP-27, JP-28, JP-29, JP-30, JP-31, JP-32, JP-33, JP-34, JP-35, JP-36, JP-37, JP-38, JP-39' | remove: ' ' | split: ',' %}

{% for province_code in shipping_address %}
  {% if shipping_zone_3 contains province_code %}
	<strong>A納品予定日:
	{% assign seconds = 3 | times: 24 | times: 60 | times: 60 %}
	{{ "now" | date: "%s" | plus: seconds | date: "%Y年%m月%d日" }}</strong><br>

  {% elsif shipping_zone_2 contains province_code %}
    <strong>B納品予定日:
    {% assign seconds = 2 | times: 24 | times: 60 | times: 60 %}
    {{ "now" | date: "%s" | plus: seconds | date: "%Y年%m月%d日" }}</strong><br>

  {% elsif shipping_zone_1 contains province_code %}
    <strong>C納品予定日:
    {% assign seconds = 1 | times: 24 | times: 60 | times: 60 %}
    {{ "now" | date: "%s" | plus: seconds | date: "%Y年%m月%d日" }}</strong><br>

  {% endif %}
{% endfor %}

 

 

0 Likes