You may have some products that require longer then others to prepare, and so need the ability to apply different advance notice rules to specific items. This guide walks you through that process.

Local Delivery

Within Shopify click Online Store

Click Actions

Click Edit code

Open your snippets/storepickup-addons.liquid file and copy and paste the following code. Remember to change the tag value from Wedding Cake to your own tag, which will trigger the advance notice change.

{% for item in cart.items %}
  {% if item.product.tags contains 'Wedding Cake' %}
    {% assign increase_notice = true %}
  {% endif %}
{% endfor %}

{% if increase_notice %}
  {% assign delivery_notice_value = 6 %}
  {% assign delivery_notice_unit = "hours" %}
  {% assign delivery_notice_breakpoint = "12:00" %}
  {% assign delivery_notice_after_breakpoint_value = 2 %}
  {% assign delivery_notice_after_breakpoint_unit = "days" %}
{% endif %}

Update the values as required. A description of each is provided below. 

Setting keys

value
The minimum time required before a customer can request delivery
Allowed values: 0 - 365

unit
The unit of time that should be used to calculate the minimum time required before a customer can request delivery
Allowed values: hours, days  

breakpoint
The time of day the breakpoint should kick in. This setting is optional.
Allowed values: 00:00 - 24:00 (i.e. 24-hour time) 

after_breakpoint_value
The minimum time required before a customer can request delivery after the breakpoint. This setting is optional.
Allowed values: 0 - 365 

after_breakpoint_unit
The unit of time that should be used to calculate the minimum time required before a customer can request delivery
Allowed values: hours, days

Click Save

Store Pickup

For store pickup follow the steps above but use the following code within your storepickup-addons file: 

{% if increase_notice %}
  {% assign pickup_notice_value = 6 %}
  {% assign pickup_notice_unit = "hours" %}
  {% assign pickup_notice_breakpoint = "12:00" %}
  {% assign pickup_notice_after_breakpoint_value = 2 %}
  {% assign pickup_notice_after_breakpoint_unit = "days" %}
{% endif %}


Shipping 

For shipping follow the steps above but use the following code within your storepickup-addons file:

{% if increase_notice %}
  {% assign shipping_notice_value = 6 %}
  {% assign shipping_notice_breakpoint = "12:00" %}
  {% assign shipping_notice_after_breakpoint_value = 2 %}
{% endif %}

Multiple products with their own notice period?

You may have multiple products that require their own notice periods, to hand this you need to ensure that the variables created are unique, they cannot overlap. In the examples above we create a variable called increase_notice. But in the event you simply copy and paste the code only the first rule you create would apply, each variable would need to be unique to apply subsequent rules.

Notice in the example below we have 2 products, our wedding cake from the example above and a birthday cake. Birthday cakes also have a unique advanced notice on this store, so we have copied the original code but adjusted the variable to be called increase_notice_2 . You can repeat this logic for as many different advanced notices as you require as long as the variable is unique.

{% for item in cart.items %}
  {% if item.product.tags contains 'Wedding Cake' %}
    {% assign increase_notice = true %}
  {% endif %}
{% endfor %}

{% if increase_notice %}
  {% assign delivery_notice_value = 6 %}
  {% assign delivery_notice_unit = "hours" %}
  {% assign delivery_notice_breakpoint = "12:00" %}
  {% assign delivery_notice_after_breakpoint_value = 2 %}
  {% assign delivery_notice_after_breakpoint_unit = "days" %}
{% endif %}

{% for item in cart.items %}
  {% if item.product.tags contains 'Birthday Cake' %}
    {% assign increase_notice_2 = true %}
  {% endif %}
{% endfor %}

{% if increase_notice_2 %}
  {% assign delivery_notice_value = 24 %}
  {% assign delivery_notice_unit = "hours" %}
  {% assign delivery_notice_breakpoint = "12:00" %}
  {% assign delivery_notice_after_breakpoint_value = 4 %}
  {% assign delivery_notice_after_breakpoint_unit = "days" %}
{% endif %}
Did this answer your question?