General Use of Estimated Delivery Date for Magento 2
How does Estimated Delivery Date for Magento 2 work?
The Estimated Delivery Date extension offers you multi-level lead times management. It allows you to establish and personalize lead times for each one of the products available in your Magento 2 website and on several levels.
Estimated Delivery Date is entirely customizable. You have the possibility to display and completely personalize delivery messages.
What are lead times?
Lead time is the latency between the initiation and the execution of a process. It is the time you need to ship the products.
With the Estimated Delivery Date extension, lead times are defined in days. You can specify lead times on different levels (store, product, attribute, configurable product, custom option...). All lead times will then be added together.
Below is an example that sums up the main configuration possibilities with Estimated Delivery Date.
Configure Estimated Delivery Date in 4 steps
To configure Estimated Delivery Date go to:
StoresConfigurationWyomind Estimated Delivery Date
STEP 1: Configure Estimated Delivery Date in a general way
First of all, be sure that the current configuration scope is Default Config.
Global settings
You can first enable the module.
- Debug enabled
When the debug option is set on Yes, the module adds debug traces to the Estimated Delivery Date output.
You should never use this option in production mode
Debug traces are visible only if your IP belongs to the group of IPs defined in the developer Client Restrictions or if no IPs have been defined. In order to add your own IP go to:
StoresConfiguration Advanced Developer Developer Client Restrictions
- Store opening days
When selecting opening days the estimated delivery date is calculated from the next opening day.
For example, if one order is placed Saturday, it will be shipped only Monday (supposing that Saturday and Sunday are days off). - Store days off
When orders are placed while the day is off, then the estimated delivery date is calculated from the next working day.
You can add an unlimited number of days off using the below format:
yyyy-mm-dd
The days must be ordered from the oldest to the newest one. - Date format
The date format uses the same parameters as the Php function date().
The date appears in the estimated delivery messages depending on that setting.
Check the PHP manual for more details:
http://php.net/manual/en/function.date.php
You can check how to personalize the date format. - Use the next available day for the "to" date if it is identical to the "from" date
If enabled, the next available day will be used for {{to_x_day}} if it is the same as {{from_x_day}} and for {{to_date}} if it is the same as {{from_date}}.
Estimated Delivery Date Message
Estimated Delivery Date allows you to display messages in the cart, in transaction emails, and/or in the customer account.
You can use several placeholders:
{{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}}
Default settings for in-stock products
- Default lead time
The lead time is the time needed to prepare, ship, and deliver the order to the customer. This value is a number of days or it can be a range of days (2 numbers separated by a hyphen).
Example of a single value:
Example of a time range value:
- Last Shipping time of the day
When an order is placed after the last shipping time of the day, then the estimated delivery date is calculated from the next working day. - Shipping days
The shipping days let you define which days your carriers work and allow you to adjust the estimated delivery date consequently. - Shipping days off
The shipping days off let you define which days your carriers don't work and allow you to adjust the estimated delivery date consequently. The dates must be ordered from the former to the more recent and must be formatted as follows:
yyyy-mm-dd
- Display a message on the category product pages
The estimated delivery date will appear on all category product pages if that option is enabled.
You can use several placeholders:
{{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}} - Display a message on the product pages
The estimated delivery date will appear on all product pages if that option is enabled.
Estimated delivery dates are displayed in real-time according to the quantities added to the cart. When quantities exceed the available stocks, the following message will be displayed:
You can use several placeholders:
{{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}}, {{countdown}} - Display the message before the product option selection (configurable products)
The Message on the product pages that you have defined previously will be displayed on any configurable product page when options are not selected (size, color, etc). The message is composed of the minimal "from" and the maximal "to" values of the configurable product variants. - Display a message for each item in cart
The estimated delivery date will appear for each item in the cart if that option is enabled.
You can use several placeholders:
{{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}} - Display a message for each item in transaction email
The estimated delivery date will appear for each item in the transaction email if that option is enabled.
You can use several placeholders:
{{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}}
Default settings for out of stock products
Estimated Delivery Date allows to define different settings for out of stock products:
- Case 1 - Product is out of stock and no backorder is allowed
Then no estimated delivery date messages show, only the default "Out of stock" message show. - Case 2 - Product is out of stock and backorders are allowed
Then the estimated delivery date messages will show depending on the out-of-stock settings (see below). - Case 3 - Product is out of stock, the backorders are allowed and the product has a re-stocking date (see how to define a restocking date)
Then the estimated delivery date messages will be calculated from the re-stocking date with the in-stock settings.
The below options must be used exactly the same way as the settings for in-stock products and applies to the out-of-stock products with backorders allowed only.
- Default lead time
- Last Shipping time of the day
- Shipping days
- Shipping days off
- Display a message on the category product pages
- Display a message on the product pages
- Display the message before the product option selection (configurable products)
- Display a message for each item in cart
- Display a message for each item in transaction email
Lead time based on attributes
You can also define additional lead times depending on attributes and define the scope of the additional lead time:
- In stock and out of stock products
- In stock products
- Out of stock products
A message will confirm that the attribute values are ready to be mapped.
Lead time based on custom options
Estimated Delivery Date also allows you to define how you want to calculate the lead times of all selected custom options:
- the lead time can be the sum of all custom options
T-Shirt S: 5 days
T-Shirt Orange: 2 daysWhen a customer orders an orange T-shirt in size S, it will require 7 days to be shipped. - the lead time can be the highest value of all custom options
T-Shirt S: 5 days
T-Shirt Orange: 2 daysWhen a customer orders an orange T-shirt in size S, it will require 5 days to be shipped.
Countdown
The countdown format can be displayed as textual or graphic.
You can define your own settings for:
- Countdown format:
daysdays, hoursdays, hours, minute days, hours, minute, seconds - Countdown in real time:
yes/no - Countdown display time:
You can choose between textual or graphic as in the example below.
Leadtime by shipping method
You can also define lead times for each shipping method. For that, select the method and click on ADD.
There you can choose to add lead times and display a message for specific shipping methods.
- Shipping method
You can use regular expressions. For example, for all methods starting with pickupatstore, write:
pickupatstore.* - Leadtimes
For the lead times, you can use lead time range separated by a hyphen. For example, from 1 to 2 shipping days:
1-2 - Message
You can use the following placeholders:
{{title}}, {{from_x_day}}, {{to_x_day}}, {{from_date}}, {{to_date}}, {{from_x_week}}, {{to_x_week}}Check how to use placeholders.
Leadtime by country & postcode
You can define additional leadtimes for specific countries and postal codes by clicking on Add leadtimes.
- Country
Choose the country for which you want to create additional leadtimes. - Postcodes
You can also add specific postal codes. - Leadtimes
Use lead time range separated by a hyphen. For example, 8 days:
8
STEP 2: Personalize the messages and the date format
Estimated Delivery Date allows you to customize the messages and date display according to your needs.
Messages display
Messages can be displayed in different places:
- on the product pages (in stock/out of stock products)
- in the cart and the checkout
- in the transaction email
- in the customer account
- for each method/rate
Placeholders
You have the possibility to personalize each one of these messages including some specific syntax just as below in order to display the lead times, the availability date, and the time left before the order is received.
You can use several placeholders according to the type of message.
- {{from_x_day}}
Number of minimum lead times (+ days off). - {{to_x_day}}
Number of maximum lead times (+ days off). - {{from_date}} = d-day + minimum lead times (+ days off).
- {{to_date}}
D-day + maximum lead times (+ days off). - {{from_x_week}}
Minimum number of weeks from which the order will be delivered (+ days off). - {{to_x_week}}
Maximum number of weeks from which the order will be delivered (+ days off). - {{countdown}}
The number of hours, minutes, and seconds before the last shipping of the day.
Only for the Message on the product pages. - {{title}}
Title of the shipping method.
Only for the Message for each shipping method.
Below are a few examples of messages including placeholders:
{{title}} - Your order will be delivered in {{to_x_week}} weeks.
This item will be ready to ship on {{from_date}}. For quick delivery, order this item in the next {{countdown}}.
PHP scripts
You can also add PHP directly in your messages:
<php if({{leadtime_from}}>1){
return "Whatever you want with any placeholder you want";
}
else{
return "something else";
}
?>
Below are some examples of what you could do with PHP:
- For the message in the product page:
<?php if ("{{from_x_day}}" <=2) { return "For quick delivery, order this item in the next {{countdown}}"; } else { return "For delivery on {{from_date}}, order this item in the next {{countdown}}"; } ?>
- For the message in the checkout:
Your order will be shipped <?php if ("{{from_x_day}}" == 2 || "{{from_x_day}}" == 1) { return "quickly"; } else { return "in {{from_x_day}} days"; } ?>. Estimated delivery date: {{from_date}}.
- For the shipping methods/rates messages:
Note that you can define a message for each shipping/method/rates.
Flat Rate message:With the Flat Rate, your order will be shipped <?php if ("{{from_x_day}}" <= 1) { return "today."; } else { return "in {{from_x_day}} days."; } ?> Estimated delivery date: {{from_date}}.
Free Shipping message:Benefit from the Free Shipping, your order will be shipped <?php if ("{{from_x_day}}" <= 1) { return "tomorrow."; } else return "in {{from_x_day}} days."; } ?> Estimated delivery date: {{from_date}}.
Date display
Estimated Delivery Date also allows you to display the format of the date as you want.
Date format
Indeed, as the date format is often different from a country to another, you can refer to the following table in order to create your own date format.
- for Sunday 5st of July 2014, write:
l jS \of F Y
You can also define some date formats for each store view:
- for the English Store view, l jS \of F Y will give:
Tuesday 26th of August 2014 - for the French Store view, l j F Y will give:
Mardi 26 Août 2014
STEP 3: Manage lead times
There are different ways to manage lead times.
You can define different lead times for each:
- store view
- product
- product attribute
- custom option
By store view
Estimated Delivery Date allows you to configure lead times according to the store view. Have a look at the Store view configuration at the top of the admin from:
StoresSettingsConfiguration Wyomind Estimated Delivery Date
When choosing a configuration scope, you have the possibility to use default data or to change the settings as you want.
For example, if you need 3 additional days to send in-stock goods to a specific store view, you can define it in the Default lead time field for that specific store view.
By product
Instead of using global settings for all products, you can use specific values for some products.
Go to:
ProductsInventoryCatalog
Choose a product and click on Edit. Go to the Estimated Delivery Date tab.
And then apply the settings that will override the global settings.
For out-of-stock products you have the possibility to define the re-stocking date, then the estimated delivery date will be calculated from that date and will use the settings of the in-stock products.
All settings can be configured at the website, store, and store-view level.
By product attribute
First of all, you need to choose the attributes to which you want to add additional lead times as well as the scope of these lead times in:
StoreSSETTINGSConfiguration Wyomind Estimated Delivery Date Lead Time Based On Attributes
A message will confirm that the attribute values are ready to be mapped.
Then go to:
Stores AttributesEstimated Delivery Date
There, you will be able to assign additional lead times for each one of the values of these attributes. As on the example below, where we added 4 lead-time days for products available in silver color.
Save all your modifications by clicking on Save all changes.
By custom option
If you want to increase the lead times for a specific custom option of a given product you can map the custom option with an additional lead time under the Customizable Options tab, from:
ProductsInventoryCatalog
Then, you can go in the Lead time based on custom options tab to choose how you want to calculate the lead time, from:
SystemConfigurationWyomind Estimated Delivery DatE
STEP 4: Check your settings
Estimated Delivery Date includes a previewing tool that helps you to check if your settings are correct and if they give the expected results.
Go to:
StoreSSETTINGSConfiguration Wyomind Estimated Delivery DateEstimated Delivery Date Preview
Estimated Delivery Date Preview
When using the preview tool, you can define:
- Product SKU
Enter the SKU of the product to check. - Website
Choose the website. - Shipping Method
Select the shipping method. - Country
Choose a country. - Postcode
Add a postcode.
Click the Go button and a preview of each message will display.