This tool is useful to display a specific date or timeframe until a product will be delivered. It’s purely based on custom input.
To enable please access Customizer > WooCommerce > Product page – Content and enable it there eg: https://d.pr/i/4KsZBL .
You can customize its display to show and exact date (eg: August 12-15 ) or number of days (eg: 3-5 Days).
How to add estimated delivery per product
Edit the product in the backend and click on the Estimated delivery tab eg: https://d.pr/i/no3Rv1 .
Enabling estimations per variation
Access Customizer > WooCommerce > Product page – Content and enable the allow overrides per variations eg: https://d.pr/i/qfOnrh . Afterwards there should be a new input in the variation settings eg: https://d.pr/i/4IOszz .
Fixing text issues (with other languages)
There are known issues with the texts of the Estimated delivery, showing strange symbols like question marks.
The days of the week are printed with PHP’s `strftime` function, so this is likely happening because the server’s PHP locale is not loading the most common locale module.
Luckily there’s a whole lot of awesome people online and this article helped me figure it out.
What you’ll need to do is to add this code in your child theme’s functions.php file:
add_filter('reycore/woocommerce/estimated_delivery', function( $settings ){ $settings['locale'] = 'fr_FR.UTF-8'; return $settings; });
As you can see instead of the most common ‘fr_FR’ locale, it’s using and extra UTF-8 declaration.
Using the shortcode
You can use the shortcode [rey_estimated_delivery] to use it anywhere you want.
Accepted parameters are:
`product_id` which defaults to 0. If you use it outside of the product scope, you will need to specify the product ID.
`title` which defaults to 1.
`wrapper` which defaults to 1. Is wrapping it inside of a div element.
`return` defaults to 0. In case you use the shortcode inline with a text, please set it to 1.
In this example
[rey_estimated_delivery wrapper="0" title="0" return="1"]