-
Notifications
You must be signed in to change notification settings - Fork 6
/
estimated-delivery-woocommerce.php
540 lines (456 loc) · 25.5 KB
/
estimated-delivery-woocommerce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
<?php
/**
* Plugin Name: Estimated Delivery for WooCommerce
* Description: Show estimated / guaranteed delivery, simple and easy
* Short Description: Show estimated / guaranteed delivery, simple and easy
* Author: Daniel Riera
* Author URI: https://danielriera.net
* Version: 1.4.5
* Text Domain: estimated-delivery-for-woocommerce
* Domain Path: /languages
* WC requires at least: 3.0
* WC tested up to: 8.8.3
* Required WP: 5.0
* Tested WP: 6.5.4
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
if(!defined('ABSPATH')) { exit; }
define('EDW_PATH', dirname(__FILE__).'/');
define('EDW_POSITION_SHOW', get_option('_edw_position', 'woocommerce_after_add_to_cart_button'));
define('EDW_USE_JS', get_option('_edw_cache', '0'));
define('EDW_Fontawesome', get_option('_edw_fontawesome', '0'));
define('EDW_Version', '1.4.5');
require_once EDW_PATH . 'class.api.php';
if(!defined('EDWCore')) {
class EDWCore {
static public $positions = array();
public $positionsClass = array(
'disabled' => 'none',
'woocommerce_after_add_to_cart_button' => 'form.cart|inside',
'woocommerce_before_add_to_cart_button' => 'form.cart|before',
'woocommerce_product_meta_end' => 'div.product_meta|after',
'woocommerce_before_single_product_summary' => 'div.woocommerce-notices-wrapper|after',
'woocommerce_after_single_product_summary' => 'div.woocommerce-tabs|after',
'woocommerce_product_thumbnails' => 'div.woocommerce-product-gallery|inside',
);
function __construct(){
add_action('admin_menu', array(&$this, 'edw_menu'));
add_action('plugins_loaded', array(&$this, 'edw_load_textdomain'));
if(EDW_USE_JS == '0') {
add_action(EDW_POSITION_SHOW, array(&$this, 'edw_show_message'));
}else{
add_action( 'wp_footer', array(&$this, 'edw_show_js'), 99 );
}
add_action( 'wp_enqueue_scripts', array(&$this, 'edw_load_style') );
add_action('save_post_product', array(&$this, 'edw_save_product'), 10, 3);
add_action( 'add_meta_boxes', array(&$this, 'edw_create_metabox_products') );
add_action( 'init', array(&$this, 'edw_add_shortcode'));
//Dokan Compatibility
add_action( 'dokan_new_product_form', array(&$this, 'edw_dokan_compatibility_content_tab') );
add_action( 'dokan_new_product_after_product_tags', array(&$this, 'edw_dokan_compatibility_content_tab') );
add_action( 'dokan_product_edit_after_product_tags', array(&$this, 'edw_dokan_compatibility_content_tab') );
//WCMF Compatiblity Version 1.3.1
add_action('end_wcfm_products_manage', array(&$this, 'edw_wcmf_content_metabox'), 100, 4);
add_action('after_wcfm_products_manage_meta_save', array(&$this, 'edw_wcmf_save_data'), 501, 2);
if(EDW_Fontawesome == '1') {
add_action( 'wp_enqueue_scripts', array($this, 'edw_load_fontawesome') );
}
//WCMP Compatiblity
add_filter( 'wcmp_product_data_tabs', array(&$this, 'edw_wcmp_compatibility_filter_tabs') );
add_action( 'wcmp_product_tabs_content', array(&$this, 'edw_wcmp_compatibility_content_tab'), 10, 3 );
add_action( 'wcmp_process_product_object', array(&$this, 'edw_save_product_data'), 10, 2 );
add_filter( 'woocommerce_get_item_data', array(&$this,'edw_display_cart_item'), 10, 2);
add_action('woocommerce_checkout_create_order_line_item', array(&$this, 'edw_save_custom_order_item_meta_data'), 10, 4 );
add_action('woocommerce_after_shop_loop_item_title', array(&$this, 'edw_show_date_list'));
add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
} );
}
function edw_wcmf_save_data($product_id, $wcfm_products_form_data) {
if(isset($wcfm_products_form_data['_edw_max_days'])) {
if(isset($wcfm_products_form_data['_edw_disabled_days']) and is_array($wcfm_products_form_data['_edw_disabled_days'])) {
//Sanitize disabled days
$disabledDays = array_map('sanitize_text_field', $wcfm_products_form_data['_edw_disabled_days']);
update_post_meta($product_id, '_edw_disabled_days', $disabledDays );
}else{
update_post_meta($product_id, '_edw_disabled_days', [] );
}
update_post_meta($product_id, '_edw_max_days',sanitize_text_field( $wcfm_products_form_data['_edw_max_days'] ));
update_post_meta($product_id, '_edw_days',sanitize_text_field( $wcfm_products_form_data['_edw_days'] ));
update_post_meta($product_id, '_edw_days_outstock',sanitize_text_field( $wcfm_products_form_data['_edw_days_outstock'] ));
update_post_meta($product_id, '_edw_max_days_outstock',sanitize_text_field( $wcfm_products_form_data['_edw_max_days_outstock'] ));
update_post_meta($product_id, '_edw_mode',sanitize_text_field( $wcfm_products_form_data['_edw_mode'] ));
update_post_meta($product_id, '_edw_days_backorders',sanitize_text_field( $wcfm_products_form_data['_edw_days_backorders'] ));
update_post_meta($product_id, '_edw_max_days_backorders',sanitize_text_field( $wcfm_products_form_data['_edw_max_days_backorders'] ));
if(isset($wcfm_products_form_data['_edw_overwrite'])) {
update_post_meta($product_id, '_edw_overwrite','1');
}else{
update_post_meta($product_id, '_edw_overwrite','0');
}
}
if(sanitize_text_field($wcfm_products_form_data['_edw_days']) == ''){
update_post_meta($product_id, '_edw_overwrite','0');
}
}
function edw_wcmf_content_metabox($product) {
$GLOBALS["product"] = $product;
include(EDW_PATH . 'views/wcfm-metabox.php');
}
function edw_show_date_list($product){
global $post;
$showOnList = get_option('edw_show_list', '0');
if($showOnList == '1') {
echo $this->edw_show_message($post);
}
}
function edw_save_custom_order_item_meta_data( $item, $cart_item_key, $values, $order ) {
$savedOnOrder = get_option('edw_save_date_order', '0');
if($savedOnOrder != '0') {
$date = $this->edw_show_message($values['product_id'], true);
if($date and is_array($date) and count($date) == 2) {
$item->update_meta_data( $date[0], $date[1] );
}
}
}
function edw_display_cart_item( $item_data, $cart_item ) {
$date = $this->edw_show_message($cart_item['product_id'], true);
if($date and is_array($date) and count($date) == 2) {
$item_data[] = array(
'key' => $date[0],
'value' => $date[1],
);
}
return $item_data;
}
function edw_wcmp_compatibility_filter_tabs($tabs) {
$tabs['edw_estimate_delivery'] = array(
'label' => __('Estimated Delivery', 'estimated-delivery-for-woocommerce'),
'target' => 'edw_estimate_delivery',
'class' => array(),
'priority' => 100,
);
return $tabs;
}
function edw_dokan_compatibility_content_tab() {
require_once(EDW_PATH . 'views/dokanmarketplace-metabox.php');
}
function edw_wcmp_compatibility_content_tab( $pro_class_obj, $product, $post ) {
$GLOBALS["product"] = $product;
require_once(EDW_PATH . 'views/wcmarketplace-metabox.php');
}
function edw_save_product_data( $product, $post_data ) {
if(isset($_POST['_edw_max_days'])) {
if(isset($_POST['_edw_disabled_days']) and is_array($_POST['_edw_disabled_days'])) {
//Sanitize disabled days
$disabledDays = array_map('sanitize_text_field', $_POST['_edw_disabled_days']);
update_post_meta($post_data['post_ID'], '_edw_disabled_days', $disabledDays );
}else{
update_post_meta($post_data['post_ID'], '_edw_disabled_days', [] );
}
update_post_meta($post_data['post_ID'], '_edw_max_days',sanitize_text_field( $_POST['_edw_max_days'] ));
update_post_meta($post_data['post_ID'], '_edw_days',sanitize_text_field( $_POST['_edw_days'] ));
update_post_meta($post_data['post_ID'], '_edw_days_outstock',sanitize_text_field( $_POST['_edw_days_outstock'] ));
update_post_meta($post_data['post_ID'], '_edw_max_days_outstock',sanitize_text_field( $_POST['_edw_max_days_outstock'] ));
update_post_meta($post_data['post_ID'], '_edw_mode',sanitize_text_field( $_POST['_edw_mode'] ));
update_post_meta($post_data['post_ID'], '_edw_days_backorders',sanitize_text_field( $_POST['_edw_days_backorders'] ));
update_post_meta($post_data['post_ID'], '_edw_max_days_backorders',sanitize_text_field( $_POST['_edw_max_days_backorders'] ));
if(isset($_POST['_edw_overwrite'])) {
update_post_meta($post_data['post_ID'], '_edw_overwrite','1');
}else{
update_post_meta($post_data['post_ID'], '_edw_overwrite','0');
}
}
if(sanitize_text_field($_POST['_edw_days']) == ''){
update_post_meta($post_data['post_ID'], '_edw_overwrite','0');
}
}
function edw_add_shortcode() {
add_shortcode( 'estimate_delivery', array($this, 'edw_prepare_shortcode') );
}
function edw_prepare_shortcode($atts) {
global $product;
$atts = shortcode_atts( array(
'product' => $product,
), $atts, 'estimate_delivery' );
return $this->edw_show_message($product);
}
function edw_create_metabox_products() {
add_meta_box( 'edw_data_product', __('Estimated Delivery', 'estimated-delivery-for-woocommerce'), array($this, 'edw_content_metabox_products'), 'product', 'normal', 'high' );
}
function edw_content_metabox_products($post) {
require_once(EDW_PATH . 'views/metabox-product.php');
}
function edw_save_product( $post_id, $post, $update ) {
if(isset($_POST['_edw_max_days'])) {
if(isset($_POST['_edw_disabled_days']) and is_array($_POST['_edw_disabled_days'])) {
//Sanitize disabled days
$disabledDays = array_map('sanitize_text_field', $_POST['_edw_disabled_days']);
update_post_meta($post_id, '_edw_disabled_days', $disabledDays );
}else{
update_post_meta($post_id, '_edw_disabled_days', [] );
}
update_post_meta($post_id, '_edw_max_days',sanitize_text_field( $_POST['_edw_max_days'] ));
update_post_meta($post_id, '_edw_days',sanitize_text_field( $_POST['_edw_days'] ));
update_post_meta($post_id, '_edw_days_outstock',sanitize_text_field( $_POST['_edw_days_outstock'] ));
update_post_meta($post_id, '_edw_max_days_outstock',sanitize_text_field( $_POST['_edw_max_days_outstock'] ));
update_post_meta($post_id, '_edw_mode',sanitize_text_field( $_POST['_edw_mode'] ));
update_post_meta($post_id, '_edw_days_backorders',sanitize_text_field( $_POST['_edw_days_backorders'] ));
update_post_meta($post_id, '_edw_max_days_backorders',sanitize_text_field( $_POST['_edw_max_days_backorders'] ));
if(isset($_POST['_edw_overwrite'])) {
update_post_meta($post_id, '_edw_overwrite','1');
}else{
update_post_meta($post_id, '_edw_overwrite','0');
}
}
if(isset($_POST['_edw_days']) and sanitize_text_field( $_POST['_edw_days']) == '') {
update_post_meta($post_id, '_edw_overwrite','0');
}
}
function edw_show_js() {
if(is_product() === true) {
global $post;
$selectPosition = explode('|', $this->positionsClass[EDW_POSITION_SHOW]);
echo '<script>jQuery(document).ready(function($) { EDW.show('.$post->ID.',\''.json_encode($selectPosition).'\'); });</script>';
}
}
function edw_load_style() {
if(is_product() === false) { return; }
wp_enqueue_script( 'edw-scripts', plugins_url('assets/edw_scripts.js?edw=true&v='.EDW_Version, __FILE__), array('jquery'));
wp_localize_script( 'edw-scripts', 'edwConfig', array(
'url' => admin_url( 'admin-ajax.php' )
) );
}
function edw_load_textdomain(){
load_plugin_textdomain( 'estimated-delivery-for-woocommerce', false, basename( dirname( __FILE__ ) ) . '/languages' );
}
function edw_menu() {
add_submenu_page('woocommerce',__('Estimated Delivery','estimated-delivery-for-woocommerce'),__('Estimated Delivery','estimated-delivery-for-woocommerce') , 'manage_options', 'edw-options', array($this, 'edw_view_page_options'));
}
function edw_view_page_options() {
self::$positions = array(
'disabled' => __('Disabled, use shortcode','estimated-delivery-for-woocommerce'),
'woocommerce_after_add_to_cart_button' => __('After cart button','estimated-delivery-for-woocommerce'),
'woocommerce_before_add_to_cart_button' => __('Before cart button','estimated-delivery-for-woocommerce'),
'woocommerce_product_meta_end' => __('After product meta','estimated-delivery-for-woocommerce'),
'woocommerce_before_single_product_summary' => __('Before product summary','estimated-delivery-for-woocommerce'),
'woocommerce_after_single_product_summary' => __('After product summary','estimated-delivery-for-woocommerce'),
'woocommerce_product_thumbnails' => __('Product Thumbnail (may not work)','estimated-delivery-for-woocommerce'),
);
self::$positions = apply_filters( 'edw_positions', self::$positions );
require_once(EDW_PATH . 'views/options.php');
}
private function get_holidays_dates() {
$holidays = get_option('_edw_holidays_dates', false);
if($holidays) {
$holidays = str_replace("XXXX", strval(date('Y')), $holidays);
$holidays = str_replace("/", "-", $holidays);
return explode(",", $holidays);
}
return array();
}
private function check_holidays_date($date) {
$holidays = $this->get_holidays_dates();
if($date and $holidays) {
return in_array($date, $holidays);
}
return false;
}
function edw_load_fontawesome() {
wp_enqueue_style( 'edw-fontawesome', plugins_url('assets/fontawesome/all.min.css?v='.EDW_Version, __FILE__));
}
private function edw_get_working_day_date($disabledDays, $daysToAdd, $dateCheck, $iteration = 0) {
if(count($disabledDays) == 7) {
return false;
}
if($iteration >= $daysToAdd) {
return $dateCheck;
}
$dateCheck = date('Y-m-d', strtotime($dateCheck . "+1 days"));
$is_holiday = $this->check_holidays_date($dateCheck);
$filterDisabled = date('D', strtotime($dateCheck));
if(!$is_holiday and is_array($disabledDays) and !in_array($filterDisabled, $disabledDays)) {
$iteration += 1;
}
return $this->edw_get_working_day_date($disabledDays, $daysToAdd, $dateCheck, $iteration);
}
/**
* Check dates if one element (day, month or year) change between
*
* @param string $date1
* @param string $date2
* @return array
* @since 1.0.2
*/
private function checkDates($date1, $date2) {
$month = false;
$day = false;
$year = false;
if(wp_date('m', strtotime($date1)) != wp_date('m', strtotime($date2))) {
$month = true;
}
if(wp_date('d', strtotime($date1)) != wp_date('d', strtotime($date2))) {
$day = true;
}
if(wp_date('Y', strtotime($date1)) != wp_date('Y', strtotime($date2))) {
$year = true;
}
return [$day, $month, $year];
}
function edw_show_message($productParam = false, $separed = false){
global $product;
$returnResult = false;
$productActive = '0';
if($productParam and $productParam != NULL) {
$product = wc_get_product($productParam);
$returnResult = true;
}
if($product == NULL) {
return '';
}
if(isset($_POST['type']) and $_POST['type'] == 'variation') {
$product_id = $product->get_parent_id();
}else{
if($product) {
$product_id = $product->get_id();
}else{
$product_id = false;
}
}
if($product_id) {
$productActive = get_post_meta($product_id, '_edw_overwrite', true);
}
if($productActive == '1') {
$mode = get_post_meta($product_id,'_edw_mode', true) || '1';
}else{
$mode = get_option('_edw_mode', '1');
}
if(!$mode) {
return '';
}
/**
* Hide for out stock products
* @since 1.0.3
*/
if( $product_id and !$product->is_in_stock()) { //OUTSTOCK
if($productActive == '1') {
$days = intval(get_post_meta($product_id,'_edw_days_outstock', true));
$maxDays = intval(get_post_meta($product_id,'_edw_max_days_outstock', true));
$disabledDays = get_post_meta($product_id,'_edw_disabled_days', true);
}else{
$maxDays = intval(get_option('_edw_max_days_outstock'));
$days = intval(get_option('_edw_days_outstock'));
$disabledDays = get_option('_edw_disabled_days');
}
//If days set is 0, return empty. No show message
if($days == 0) {
return '<div class="edw_date" style="display:none"></div>';
}
}else if($product->is_on_backorder()){ //BACKORDER
if($productActive == '1') {
$days = intval(get_post_meta($product_id,'_edw_days_backorders', true));
$maxDays = intval(get_post_meta($product_id,'_edw_max_days_backorders', true));
$disabledDays = get_post_meta($product_id,'_edw_disabled_days', true);
}else{
$maxDays = intval(get_option('_edw_max_days_backorders'));
$days = intval(get_option('_edw_days_backorders'));
$disabledDays = get_option('_edw_disabled_days');
}
}else{
//Check Product configuration
if($productActive == '1' and $product_id ) {
$days = intval(get_post_meta($product_id,'_edw_days', true));
$maxDays = intval(get_post_meta($product_id,'_edw_max_days', true));
$disabledDays = get_post_meta($product_id,'_edw_disabled_days', true);
}else{
$days = intval(get_option('_edw_days'));
$maxDays = intval(get_option('_edw_max_days'));
$disabledDays = get_option('_edw_disabled_days');
}
}
if($days == 0 and get_option('_edw_same_day', '0') == '0') {
return '';
}
$time_max = get_option('_edw_max_hour', '');
if($time_max) {
$wpTimezone = wp_timezone();
$hourNow = date_create('now', $wpTimezone);
if(strtotime($time_max) <= strtotime($hourNow->format('H:i'))) {
$days++;
if($maxDays) {
$maxDays++;
}
}
}
//Prevent default
$maxDays = intval($maxDays);
$disabledDays = $disabledDays ?: [];
$today = wp_date('Y-m-d');
$minDate = $this->edw_get_working_day_date($disabledDays, $days, $today);
if($minDate) {
$dateDiff = $maxDays - $days;
$maxDate = $this->edw_get_working_day_date($disabledDays, $dateDiff, $minDate);
}
if($minDate && $maxDate) {
$date_format = get_option('date_format');
$useRelativeDates = get_option('_edw_relative_dates', false);
$elon = __(" on", "estimated-delivery-for-woocommerce");
$date = date_i18n("{$date_format}", strtotime($minDate));
if($maxDays > 0) {
list($d, $m, $y) = $this->checkDates($minDate, $maxDate);
if(!$d && !$m && !$y) {
$thisWeek = wp_date('W');
if( $useRelativeDates && $thisWeek == wp_date('W', strtotime($minDate)) ) {
$elon = "";
$date = sprintf( __("this %s, %s", "estimated-delivery-for-woocommerce"), date_i18n("l", strtotime($minDate)), date_i18n("j F", strtotime($minDate)));
}elseif( $useRelativeDates && ($thisWeek+1) == wp_date('W', strtotime($minDate)) ) {
$elon = "";
$date = sprintf( __("the next %s, %s", "estimated-delivery-for-woocommerce"), date_i18n("l", strtotime($minDate)), date_i18n("j F", strtotime($minDate)));
}
}else{
if($d && !$m && !$y) {
//00 - 00 MM, YYYY
$date = date_i18n(get_option('_edw_date_format_1_0', 'j'), strtotime($minDate)) . ' - ' . date_i18n(get_option('_edw_date_format_1_1', "j F, Y"), strtotime($maxDate));
}elseif($d && $m && !$y) {
// 00 MM - 00 MM, YYYY
$date = date_i18n(get_option('_edw_date_format_2_0', 'j F'), strtotime($minDate)) . ' - ' . date_i18n(get_option('_edw_date_format_2_1', "j F, Y"), strtotime($maxDate));
}else{
// 00 MM YYYY - 00 MM YYYY
$date = date_i18n(get_option('_edw_date_format_3_0',"j F Y"), strtotime($minDate)) . ' - ' . date_i18n(get_option('_edw_date_format_3_1',"j F Y"), strtotime($maxDate));
}
}
}else{
$thisWeek = wp_date('W');
if( $useRelativeDates && $thisWeek == wp_date('W', strtotime($minDate)) ) {
$elon = "";
$date = sprintf( __("this %s, %s", "estimated-delivery-for-woocommerce"), date_i18n("l", strtotime($minDate)), date_i18n("j F", strtotime($minDate)));
}elseif( $useRelativeDates && ($thisWeek+1) == wp_date('W', strtotime($minDate)) ) {
$elon = "";
$date = sprintf( __("the next %s, %s", "estimated-delivery-for-woocommerce"), date_i18n("l", strtotime($minDate)), date_i18n("j F", strtotime($minDate)));
}
}
$iconset = get_option('_edw_icon', '');
$icon_html = $iconset != '' ? '<i class="' . $iconset . '"></i> ' : '';
if($mode == "1") {
$separed_title = __('Estimated delivery', 'estimated-delivery-for-woocommerce');
$string = '<div class="edw_date">'.$icon_html.sprintf(__('Estimated delivery%s %s','estimated-delivery-for-woocommerce'), $elon, $date).'</div>';
}else{
$separed_title = __('Guaranteed delivery','estimated-delivery-for-woocommerce');
$string = '<div class="edw_date">'.$icon_html.sprintf(__('Guaranteed delivery%s %s','estimated-delivery-for-woocommerce'), $elon, $date).'</div>';
}
if($returnResult) {
if($separed) {
return [$separed_title, $elon . ' ' . $date];
}
return $string;
}
echo $string;
}
return '';
}
}
}
$EDWCore = new EDWCore();
?>