Abandoned Cart Lite for WooCommerce - Version 5.11.0

Version Description

( 02.11.2021 ) = * Enhancement - Added a new merge tag to include Coupon codes in email reminders. * Enhancement - Users can now set up the plugin to generate a unique coupon code in the reminder email or use an existing coupon created in Marketing > Coupons. * Enhancement - Coupons sent in reminder emails will be auto-applied when the cart link in the reminder email is accessed. * Enhancement - The site admin can now set up the plugin to automatically delete the expired and/or used coupons created by the plugin using WP Cron or delete them manually from the plugin settings page.

Download this release

Release Info

Developer tychesoftwares
Plugin Icon 128x128 Abandoned Cart Lite for WooCommerce
Version 5.11.0
Comparing to
See all releases

Code changes from version 5.10.0 to 5.11.0

assets/js/abandoncart_plugin_button.js CHANGED
@@ -67,6 +67,14 @@
67
  editor.insertContent(this.value());
68
  }
69
  }
 
 
 
 
 
 
 
 
70
 
71
  ]
72
  });
67
  editor.insertContent(this.value());
68
  }
69
  }
70
+ ,
71
+ {
72
+ text: 'Coupon Code',
73
+ value: '{{coupon.code}}',
74
+ onclick: function() {
75
+ editor.insertContent(this.value());
76
+ }
77
+ }
78
 
79
  ]
80
  });
assets/js/admin/wcal_ts_dismiss_notice.js CHANGED
@@ -16,4 +16,30 @@ jQuery(document).ready( function() {
16
  });
17
 
18
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  });
16
  });
17
 
18
  });
19
+
20
+ jQuery('#wcal_delete_coupons').click( function( event ) {
21
+ var msg = "Are you sure you want delete the expired and used coupons created by Abandonment Cart Pro for WooCommerce Plugin?";
22
+ var status = confirm( msg );
23
+ if ( status == true ) {
24
+ // disable delete button and show loader
25
+ jQuery("#wcal_delete_coupons").attr( "disabled", true );
26
+ jQuery( ".wcal-spinner" ).removeAttr( "style" );
27
+
28
+ jQuery.post( ajaxurl, {
29
+ action: 'wcal_delete_expired_used_coupon_code',
30
+ }, function() {
31
+
32
+ }).done(function( data ) {
33
+ jQuery( "#wcal_delete_coupons" ).attr( "disabled", false );
34
+ jQuery( ".wcal-spinner" ).hide();
35
+ jQuery( ".wcal-coupon-response-msg" ).html( data.data );
36
+ jQuery( ".wcal-coupon-response-msg" ).fadeOut(3000);
37
+ }).fail(function( data ) {
38
+ jQuery( "#wcal_delete_coupons" ).attr( "disabled", false );
39
+ jQuery( ".wcal-spinner" ).hide();
40
+ jQuery( ".wcal-coupon-response-msg" ).html( "Something went wrong. Please try deleting again." );
41
+ jQuery( ".wcal-coupon-response-msg" ).fadeOut(3000);
42
+ });
43
+ }
44
+ });
45
  });
class-wcal-update.php CHANGED
@@ -257,9 +257,28 @@ if ( ! class_exists( 'Wcal_Update' ) ) {
257
  if ( isset( $results, $results[0]->Type ) && ( $results[0]->Type !== "ENUM('Days','Hours','Minutes')" ) ) { //phpcs:ignore
258
  $wpdb->query( 'ALTER TABLE ' . $db_prefix . "ac_email_templates_lite CHANGE `day_or_hour` `day_or_hour` ENUM('Days','Hours','Minutes') CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL" ); //phpcs:ignore
259
  }
260
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
-
263
  /**
264
  * Add a new column email_reminder_status in the cart history lite table.
265
  *
257
  if ( isset( $results, $results[0]->Type ) && ( $results[0]->Type !== "ENUM('Days','Hours','Minutes')" ) ) { //phpcs:ignore
258
  $wpdb->query( 'ALTER TABLE ' . $db_prefix . "ac_email_templates_lite CHANGE `day_or_hour` `day_or_hour` ENUM('Days','Hours','Minutes') CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL" ); //phpcs:ignore
259
  }
260
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'coupon_code'" ) ) { //phpcs:ignore
261
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `coupon_code` varchar(50) NOT NULL AFTER `wc_email_header`' ); //phpcs:ignore
262
+ }
263
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'generate_unique_coupon_code'" ) ) { //phpcs:ignore
264
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `generate_unique_coupon_code` ENUM("0","1") CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL AFTER `coupon_code`' ); //phpcs:ignore
265
+ }
266
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'discount'" ) ) { //phpcs:ignore
267
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `discount` varchar(50) NOT NULL AFTER `generate_unique_coupon_code`' ); //phpcs:ignore
268
+ }
269
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'discount_type'" ) ) { //phpcs:ignore
270
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `discount_type` varchar(50) NOT NULL AFTER `discount`' ); //phpcs:ignore
271
+ }
272
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'discount_shipping'" ) ) { //phpcs:ignore
273
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `discount_shipping` varchar(50) NOT NULL AFTER `discount_type`' ); //phpcs:ignore
274
+ }
275
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'discount_expiry'" ) ) { //phpcs:ignore
276
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `discount_expiry` varchar(50) NOT NULL AFTER `discount_shipping`' ); //phpcs:ignore
277
+ }
278
+ if ( ! $wpdb->get_var( 'SHOW COLUMNS FROM ' . $db_prefix . "ac_email_templates_lite LIKE 'individual_use'" ) ) { //phpcs:ignore
279
+ $wpdb->query( 'ALTER TABLE ' . $db_prefix . 'ac_email_templates_lite ADD COLUMN `individual_use` ENUM("0","1") CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL AFTER `discount_expiry`' ); //phpcs:ignore
280
+ }
281
  }
 
282
  /**
283
  * Add a new column email_reminder_status in the cart history lite table.
284
  *
cron/class-wcal-cron.php CHANGED
@@ -59,6 +59,7 @@ if ( ! class_exists( 'Wcal_Cron' ) ) {
59
  }
60
 
61
  foreach ( $results as $key => $value ) {
 
62
  if ( 'Minutes' === $value->day_or_hour ) {
63
  $time_to_send_template_after = intval( $value->frequency ) * 60;
64
  } elseif ( 'Days' === $value->day_or_hour ) {
@@ -284,8 +285,14 @@ if ( ! class_exists( 'Wcal_Cron' ) ) {
284
  $encoding_cart = $email_sent_id . '&url=' . $cart_page_link . $utm;
285
  $validate_cart = $this->wcal_encrypt_validate( $encoding_cart );
286
  $cart_link_track = get_option( 'siteurl' ) . '/?wcal_action=track_links&validate=' . $validate_cart;
287
- $email_body = str_ireplace( '{{cart.link}}', $cart_link_track, $email_body );
288
 
 
 
 
 
 
 
 
289
  $validate_unsubscribe = $this->wcal_encrypt_validate( $email_sent_id );
290
  if ( count( $results_sent ) > 0 && isset( $results_sent[0]->sent_email_id ) ) {
291
  $email_sent_id_address = $results_sent[0]->sent_email_id;
59
  }
60
 
61
  foreach ( $results as $key => $value ) {
62
+ $wc_email_template = $value;
63
  if ( 'Minutes' === $value->day_or_hour ) {
64
  $time_to_send_template_after = intval( $value->frequency ) * 60;
65
  } elseif ( 'Days' === $value->day_or_hour ) {
285
  $encoding_cart = $email_sent_id . '&url=' . $cart_page_link . $utm;
286
  $validate_cart = $this->wcal_encrypt_validate( $encoding_cart );
287
  $cart_link_track = get_option( 'siteurl' ) . '/?wcal_action=track_links&validate=' . $validate_cart;
 
288
 
289
+ list( $email_body , $coupon_code_to_apply ) = wcal_common::wcal_check_and_replace_email_tag( $email_body, $wc_email_template );
290
+ if ( '' !== $coupon_code_to_apply ) {
291
+ $encypted_coupon_code = $this->wcal_encrypt_validate( $coupon_code_to_apply );
292
+ $cart_link_track .= '&c=' . $encypted_coupon_code;
293
+ }
294
+
295
+ $email_body = str_ireplace( '{{cart.link}}', $cart_link_track, $email_body );
296
  $validate_unsubscribe = $this->wcal_encrypt_validate( $email_sent_id );
297
  if ( count( $results_sent ) > 0 && isset( $results_sent[0]->sent_email_id ) ) {
298
  $email_sent_id_address = $results_sent[0]->sent_email_id;
i18n/languages/woocommerce-abandoned-cart.pot CHANGED
@@ -2,16 +2,16 @@
2
  # This file is distributed under the same license as the Abandoned Cart Lite for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Abandoned Cart Lite for WooCommerce 5.10.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-abandoned-cart\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-08-23T10:08:32+02:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: woocommerce-abandoned-cart\n"
16
 
17
  #. Plugin Name of the plugin
@@ -34,70 +34,70 @@ msgstr ""
34
  msgid "http://www.tychesoftwares.com/"
35
  msgstr ""
36
 
37
- #: cron/class-wcal-cron.php:90
38
  msgid "Abandoned cart reminder"
39
  msgstr ""
40
 
41
- #: cron/class-wcal-cron.php:295
42
- #: woocommerce-ac.php:2964
43
- #: woocommerce-ac.php:3786
44
- #: woocommerce-ac.php:3821
45
  msgid "Quantity"
46
  msgstr ""
47
 
48
- #: cron/class-wcal-cron.php:296
49
- #: woocommerce-ac.php:3787
50
- #: woocommerce-ac.php:3822
51
  msgid "Price"
52
  msgstr ""
53
 
54
- #: cron/class-wcal-cron.php:297
55
- #: woocommerce-ac.php:2965
56
- #: woocommerce-ac.php:3788
57
- #: woocommerce-ac.php:3823
58
  msgid "Line Subtotal"
59
  msgstr ""
60
 
61
- #: cron/class-wcal-cron.php:302
62
  #: cron/class-wcal-cron.php:313
63
- #: woocommerce-ac.php:3782
64
- #: woocommerce-ac.php:3816
 
65
  msgid "Your Shopping Cart"
66
  msgstr ""
67
 
68
- #: cron/class-wcal-cron.php:304
69
  #: cron/class-wcal-cron.php:315
70
- #: woocommerce-ac.php:2962
71
- #: woocommerce-ac.php:3784
72
- #: woocommerce-ac.php:3819
 
73
  msgid "Item"
74
  msgstr ""
75
 
76
- #: cron/class-wcal-cron.php:305
77
  #: cron/class-wcal-cron.php:316
78
- #: woocommerce-ac.php:2963
79
- #: woocommerce-ac.php:3785
80
- #: woocommerce-ac.php:3820
 
81
  msgid "Name"
82
  msgstr ""
83
 
84
- #: cron/class-wcal-cron.php:339
85
- #: cron/class-wcal-cron.php:371
86
  msgid "SKU: "
87
  msgstr ""
88
 
89
- #: cron/class-wcal-cron.php:422
90
- #: woocommerce-ac.php:3808
91
- #: woocommerce-ac.php:3843
92
  msgid "Cart Total:"
93
  msgstr ""
94
 
95
- #: cron/class-wcal-cron.php:434
96
  msgid "Product no longer exists"
97
  msgstr ""
98
 
99
- #: cron/class-wcal-cron.php:647
100
- #: cron/class-wcal-cron.php:716
101
  #: includes/frontend/class-wcal-checkout-process.php:220
102
  #: includes/frontend/class-wcal-checkout-process.php:557
103
  msgid "This order was abandoned & subsequently recovered."
@@ -132,7 +132,7 @@ msgid "ANONYMIZED"
132
  msgstr ""
133
 
134
  #: includes/admin/class-wcal-personal-data-export.php:137
135
- #: woocommerce-ac.php:1255
136
  msgid "Abandoned Carts"
137
  msgstr ""
138
 
@@ -198,8 +198,8 @@ msgstr ""
198
 
199
  #: includes/admin/class-wcap-add-cart-popup-modal.php:84
200
  #: includes/admin/class-wcap-pro-settings.php:66
201
- #: includes/admin/class-wcap-pro-settings.php:384
202
- #: woocommerce-ac.php:3532
203
  msgid "Save Changes"
204
  msgstr ""
205
 
@@ -273,6 +273,7 @@ msgid "Coupon code to apply:"
273
  msgstr ""
274
 
275
  #: includes/admin/class-wcap-add-cart-popup-modal.php:393
 
276
  msgid "Discount Type:"
277
  msgstr ""
278
 
@@ -433,223 +434,203 @@ msgstr ""
433
  msgid "Enter DeBounce JS API Key."
434
  msgstr ""
435
 
436
- #: includes/admin/class-wcap-pro-settings.php:181
437
- msgid "Coupon Settings"
438
- msgstr ""
439
-
440
- #: includes/admin/class-wcap-pro-settings.php:188
441
- msgid "Delete Coupons Automatically"
442
- msgstr ""
443
-
444
- #: includes/admin/class-wcap-pro-settings.php:192
445
- msgid "Enable this setting if you want to completely remove the expired and used coupon code automatically every 15 days."
446
- msgstr ""
447
-
448
- #: includes/admin/class-wcap-pro-settings.php:197
449
- msgid "Delete Coupons Manually"
450
- msgstr ""
451
-
452
- #: includes/admin/class-wcap-pro-settings.php:201
453
- msgid "If you want to completely remove the expired and used coupon code now then click on \"Delete\" button."
454
- msgstr ""
455
-
456
- #: includes/admin/class-wcap-pro-settings.php:266
457
  msgid "Product Image( H x W )"
458
  msgstr ""
459
 
460
- #: includes/admin/class-wcap-pro-settings.php:270
461
  msgid "This setting affects the dimension of the product image in the abandoned cart reminder email."
462
  msgstr ""
463
 
464
- #: includes/admin/class-wcap-pro-settings.php:294
465
  msgid "Setting for sending Emails & SMS using Action Scheduler"
466
  msgstr ""
467
 
468
- #: includes/admin/class-wcap-pro-settings.php:301
469
  msgid "Send Abandoned cart emails automatically using Action Scheduler"
470
  msgstr ""
471
 
472
- #: includes/admin/class-wcap-pro-settings.php:305
473
  msgid "Enabling this setting will send the abandoned cart reminder emails to the customer after the set time. If disabled, abandoned cart reminder emails will not be sent using the Action Scheduler. You will need to set cron job manually from cPanel. If you are unsure how to set the cron job, please <a href= mailto:support@tychesoftwares.com>contact us</a> for it."
474
  msgstr ""
475
 
476
- #: includes/admin/class-wcap-pro-settings.php:310
477
  msgid "Run automated Scheduler every X minutes"
478
  msgstr ""
479
 
480
- #: includes/admin/class-wcap-pro-settings.php:314
481
  msgid "The duration in minutes after which an action should be automatically scheduled to send email, SMS & FB reminders to customers."
482
  msgstr ""
483
 
484
- #: includes/admin/class-wcap-pro-settings.php:319
485
  msgid "Rules to exclude capturing abandoned carts"
486
  msgstr ""
487
 
488
- #: includes/admin/class-wcap-pro-settings.php:326
489
  msgid "Do not capture abandoned carts for these IP addresses"
490
  msgstr ""
491
 
492
- #: includes/admin/class-wcap-pro-settings.php:330
493
  msgid "The carts abandoned from these IP addresses will not be tracked by the plugin. Accepts wildcards, e.g <code>192.168.*</code> will block all IP addresses which starts from \"192.168\". <i>Separate IP addresses with commas.</i>"
494
  msgstr ""
495
 
496
- #: includes/admin/class-wcap-pro-settings.php:335
497
  msgid "Do not capture abandoned carts for these email addresses"
498
  msgstr ""
499
 
500
- #: includes/admin/class-wcap-pro-settings.php:339
501
  msgid "The carts abandoned using these email addresses will not be tracked by the plugin. <i>Separate email addresses with commas.</i>"
502
  msgstr ""
503
 
504
- #: includes/admin/class-wcap-pro-settings.php:344
505
  msgid "Do not capture abandoned carts for email addresses from these domains"
506
  msgstr ""
507
 
508
- #: includes/admin/class-wcap-pro-settings.php:348
509
  msgid "The carts abandoned from email addresses with these domains will not be tracked by the plugin. <i>Separate email address domains with commas.</i>"
510
  msgstr ""
511
 
512
- #: includes/admin/class-wcap-pro-settings.php:353
513
  msgid "Unsubscribe Settings"
514
  msgstr ""
515
 
516
- #: includes/admin/class-wcap-pro-settings.php:361
517
  msgid "Unsubscribe Landing Page"
518
  msgstr ""
519
 
520
- #: includes/admin/class-wcap-pro-settings.php:390
521
  msgid "Send Test SMS"
522
  msgstr ""
523
 
524
- #: includes/admin/class-wcap-pro-settings.php:394
525
  msgid "Recipient"
526
  msgstr ""
527
 
528
- #: includes/admin/class-wcap-pro-settings.php:397
529
  msgid "Must be a valid phone number in E.164 format."
530
  msgstr ""
531
 
532
- #: includes/admin/class-wcap-pro-settings.php:402
533
  msgid "Message"
534
  msgstr ""
535
 
536
- #: includes/admin/class-wcap-pro-settings.php:403
537
  msgid "Hello World!"
538
  msgstr ""
539
 
540
- #: includes/admin/class-wcap-pro-settings.php:425
541
  msgid "Twilio"
542
  msgstr ""
543
 
544
- #: includes/admin/class-wcap-pro-settings.php:432
545
  msgid "Enable SMS"
546
  msgstr ""
547
 
548
- #: includes/admin/class-wcap-pro-settings.php:436
549
  msgid "<i>Enable the ability to send reminder SMS for abandoned carts.</i>"
550
  msgstr ""
551
 
552
- #: includes/admin/class-wcap-pro-settings.php:441
553
  msgid "From"
554
  msgstr ""
555
 
556
- #: includes/admin/class-wcap-pro-settings.php:445
557
  msgid "<i>Must be a Twilio phone number (in E.164 format) or alphanumeric sender ID.</i>"
558
  msgstr ""
559
 
560
- #: includes/admin/class-wcap-pro-settings.php:450
561
  msgid "Account SID"
562
  msgstr ""
563
 
564
- #: includes/admin/class-wcap-pro-settings.php:459
565
  msgid "Auth Token"
566
  msgstr ""
567
 
568
- #: includes/admin/class-wcap-pro-settings.php:488
569
  msgid "Facebook Messenger Settings"
570
  msgstr ""
571
 
572
- #: includes/admin/class-wcap-pro-settings.php:495
573
  msgid "Enable Facebook Messenger Reminders"
574
  msgstr ""
575
 
576
- #: includes/admin/class-wcap-pro-settings.php:499
577
  msgid "<i>This option will display a checkbox after the Add to cart button for user consent to connect with Facebook.</i>"
578
  msgstr ""
579
 
580
- #: includes/admin/class-wcap-pro-settings.php:504
581
  msgid "Facebook Messenger on Add to Cart Pop-up modal"
582
  msgstr ""
583
 
584
- #: includes/admin/class-wcap-pro-settings.php:508
585
  msgid "<i>This option will display a checkbox on the pop-up modal to connect with Facebook.</i>"
586
  msgstr ""
587
 
588
- #: includes/admin/class-wcap-pro-settings.php:513
589
  msgid "Icon size of user"
590
  msgstr ""
591
 
592
- #: includes/admin/class-wcap-pro-settings.php:518
593
  msgid "<i>Select the size of user icon which shall be displayed below the checkbox in case the user is logged in.</i>"
594
  msgstr ""
595
 
596
- #: includes/admin/class-wcap-pro-settings.php:521
597
  msgid "Small"
598
  msgstr ""
599
 
600
- #: includes/admin/class-wcap-pro-settings.php:522
601
  msgid "Medium"
602
  msgstr ""
603
 
604
- #: includes/admin/class-wcap-pro-settings.php:523
605
  msgid "Large"
606
  msgstr ""
607
 
608
- #: includes/admin/class-wcap-pro-settings.php:524
609
  msgid "Standard"
610
  msgstr ""
611
 
612
- #: includes/admin/class-wcap-pro-settings.php:525
613
  msgid "Extra Large"
614
  msgstr ""
615
 
616
- #: includes/admin/class-wcap-pro-settings.php:532
617
  msgid "Consent text"
618
  msgstr ""
619
 
620
- #: includes/admin/class-wcap-pro-settings.php:536
621
  msgid "<i>Text that will appear above the consent checkbox. HTML tags are also allowed.</i>"
622
  msgstr ""
623
 
624
- #: includes/admin/class-wcap-pro-settings.php:541
625
  msgid "Facebook Page ID"
626
  msgstr ""
627
 
628
- #: includes/admin/class-wcap-pro-settings.php:545
629
  msgid "<i>Facebook Page ID in numberic format. You can find your page ID from <a href='https://www.tychesoftwares.com/docs/docs/abandoned-cart-pro-for-woocommerce/send-abandoned-cart-reminder-notifications-using-facebook-messenger#fbpageid' target='_blank'>here</a></i>"
630
  msgstr ""
631
 
632
- #: includes/admin/class-wcap-pro-settings.php:550
633
  msgid "Messenger App ID"
634
  msgstr ""
635
 
636
- #: includes/admin/class-wcap-pro-settings.php:554
637
  msgid "<i>Enter your Messenger App ID</i>"
638
  msgstr ""
639
 
640
- #: includes/admin/class-wcap-pro-settings.php:559
641
  msgid "Facebook Page Token"
642
  msgstr ""
643
 
644
- #: includes/admin/class-wcap-pro-settings.php:563
645
  msgid "<i>Enter your Facebook Page Token</i>"
646
  msgstr ""
647
 
648
- #: includes/admin/class-wcap-pro-settings.php:568
649
  msgid "Verify Token"
650
  msgstr ""
651
 
652
- #: includes/admin/class-wcap-pro-settings.php:572
653
  msgid "<i>Enter your Verify Token</i>"
654
  msgstr ""
655
 
@@ -826,7 +807,7 @@ msgid "<strong>%s%%</strong> of Total Revenue"
826
  msgstr ""
827
 
828
  #: includes/classes/class-wcal-dashboard-report.php:161
829
- #: woocommerce-ac.php:2086
830
  msgid "Abandoned Orders"
831
  msgstr ""
832
 
@@ -891,7 +872,7 @@ msgid "Select date range:"
891
  msgstr ""
892
 
893
  #: includes/classes/class-wcal-dashboard-report.php:319
894
- #: woocommerce-ac.php:2915
895
  msgid "Go"
896
  msgstr ""
897
 
@@ -984,371 +965,443 @@ msgstr ""
984
  msgid "<b><i>Upgrade to <a href='%s' target='_blank'>Abandoned Cart Pro for WooCommerce</a> to enable the feature.</i></b>"
985
  msgstr ""
986
 
987
- #: woocommerce-ac.php:292
988
- #: woocommerce-ac.php:731
989
- #: woocommerce-ac.php:2100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
990
  msgid "Settings"
991
  msgstr ""
992
 
993
- #: woocommerce-ac.php:321
994
  msgid "Emails are not being sent to customers."
995
  msgstr ""
996
 
997
- #: woocommerce-ac.php:327
998
  msgid "Capturing of cart and other information was not satisfactory."
999
  msgstr ""
1000
 
1001
- #: woocommerce-ac.php:333
1002
  msgid "I cannot see abandoned cart reminder emails records."
1003
  msgstr ""
1004
 
1005
- #: woocommerce-ac.php:339
1006
  msgid "I want to upgrade the plugin to the PRO version."
1007
  msgstr ""
1008
 
1009
- #: woocommerce-ac.php:462
1010
  msgid "HTML Email Template"
1011
  msgstr ""
1012
 
1013
- #: woocommerce-ac.php:468
1014
  msgid "Abandoned cart Email Template"
1015
  msgstr ""
1016
 
1017
- #: woocommerce-ac.php:738
1018
  msgid "Enable abandoned cart emails"
1019
  msgstr ""
1020
 
1021
- #: woocommerce-ac.php:742
1022
  msgid "Yes, enable the abandoned cart emails."
1023
  msgstr ""
1024
 
1025
- #: woocommerce-ac.php:747
1026
  msgid "Cart abandoned cut-off time"
1027
  msgstr ""
1028
 
1029
- #: woocommerce-ac.php:751
1030
  msgid "Consider cart abandoned after X minutes of item being added to cart & order not placed."
1031
  msgstr ""
1032
 
1033
- #: woocommerce-ac.php:756
1034
  msgid "Automatically Delete Abandoned Orders after X days"
1035
  msgstr ""
1036
 
1037
- #: woocommerce-ac.php:760
1038
  msgid "Automatically delete abandoned cart orders after X days."
1039
  msgstr ""
1040
 
1041
- #: woocommerce-ac.php:765
1042
  msgid "Email admin On Order Recovery"
1043
  msgstr ""
1044
 
1045
- #: woocommerce-ac.php:769
1046
  msgid "Sends email to Admin if an Abandoned Cart Order is recovered."
1047
  msgstr ""
1048
 
1049
- #: woocommerce-ac.php:774
1050
  msgid "Start tracking from Cart Page"
1051
  msgstr ""
1052
 
1053
- #: woocommerce-ac.php:778
1054
  msgid "Enable tracking of abandoned products & carts even if customer does not visit the checkout page or does not enter any details on the checkout page like Name or Email. Tracking will begin as soon as a visitor adds a product to their cart and visits the cart page."
1055
  msgstr ""
1056
 
1057
- #: woocommerce-ac.php:783
1058
  msgid "Message to be displayed for Guest users when tracking their carts"
1059
  msgstr ""
1060
 
1061
- #: woocommerce-ac.php:787
1062
  msgid "<br>In compliance with GDPR, add a message on the Checkout page to inform Guest users of how their data is being used.<br><i>For example: Your email address will help us support your shopping experience throughout the site. Please check our Privacy Policy to see how we use your personal data.</i>"
1063
  msgstr ""
1064
 
1065
- #: woocommerce-ac.php:792
1066
  msgid "Message to be displayed for registered users when tracking their carts."
1067
  msgstr ""
1068
 
1069
- #: woocommerce-ac.php:796
1070
  msgid "<br>In compliance with GDPR, add a message on the Shop & Product pages to inform Registered users of how their data is being used.<br><i>For example: Please check our Privacy Policy to see how we use your personal data.</i>"
1071
  msgstr ""
1072
 
1073
- #: woocommerce-ac.php:801
1074
  msgid "Allow the visitor to opt out of cart tracking."
1075
  msgstr ""
1076
 
1077
- #: woocommerce-ac.php:805
1078
  msgid "<br>In compliance with GDPR, allow the site visitor (guests & registered users) to opt out from cart tracking. This message will be displayed in conjunction with the GDPR message above.</i>"
1079
  msgstr ""
1080
 
1081
- #: woocommerce-ac.php:810
1082
  msgid "Message to be displayed when the user chooses to opt out of cart tracking."
1083
  msgstr ""
1084
 
1085
- #: woocommerce-ac.php:814
1086
  msgid "<br>Message to be displayed when the user chooses to opt out of cart tracking.</i>"
1087
  msgstr ""
1088
 
1089
- #: woocommerce-ac.php:824
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1090
  msgid "Settings for abandoned cart recovery emails"
1091
  msgstr ""
1092
 
1093
- #: woocommerce-ac.php:831
1094
  msgid "\"From\" Name"
1095
  msgstr ""
1096
 
1097
- #: woocommerce-ac.php:840
1098
  msgid "\"From\" Address"
1099
  msgstr ""
1100
 
1101
- #: woocommerce-ac.php:849
1102
  msgid "Send Reply Emails to"
1103
  msgstr ""
1104
 
1105
- #: woocommerce-ac.php:994
 
 
 
 
 
 
 
 
1106
  msgid "Abandoned cart cut off time should be numeric and has to be greater than 0."
1107
  msgstr ""
1108
 
1109
- #: woocommerce-ac.php:1011
1110
  msgid "Automatically Delete Abandoned Orders after X days has to be greater than 0."
1111
  msgstr ""
1112
 
1113
- #: woocommerce-ac.php:2079
1114
  msgid "Dashboard"
1115
  msgstr ""
1116
 
1117
- #: woocommerce-ac.php:2093
1118
  msgid "Email Templates"
1119
  msgstr ""
1120
 
1121
- #: woocommerce-ac.php:2107
1122
  msgid "Recovered Orders"
1123
  msgstr ""
1124
 
1125
- #: woocommerce-ac.php:2114
1126
  msgid "Product Report"
1127
  msgstr ""
1128
 
1129
- #: woocommerce-ac.php:2358
1130
  msgid "You do not have sufficient permissions to access this page."
1131
  msgstr ""
1132
 
1133
- #: woocommerce-ac.php:2362
1134
  msgid "WooCommerce - Abandon Cart Lite"
1135
  msgstr ""
1136
 
1137
- #: woocommerce-ac.php:2434
1138
  msgid "The Abandoned cart has been successfully deleted."
1139
  msgstr ""
1140
 
1141
- #: woocommerce-ac.php:2436
1142
  msgid "All Abandoned Carts have been successfully deleted."
1143
  msgstr ""
1144
 
1145
- #: woocommerce-ac.php:2438
1146
  msgid "All Visitor carts have been successfully deleted."
1147
  msgstr ""
1148
 
1149
- #: woocommerce-ac.php:2440
1150
  msgid "All Guest carts have been successfully deleted."
1151
  msgstr ""
1152
 
1153
- #: woocommerce-ac.php:2442
1154
  msgid "All Registered carts have been deleted."
1155
  msgstr ""
1156
 
1157
- #: woocommerce-ac.php:2453
1158
  msgid "The Template has been successfully deleted."
1159
  msgstr ""
1160
 
1161
- #: woocommerce-ac.php:2460
1162
  msgid "Change settings for sending email notifications to Customers, to Admin etc."
1163
  msgstr ""
1164
 
1165
- #: woocommerce-ac.php:2494
1166
  msgid "General Settings"
1167
  msgstr ""
1168
 
1169
- #: woocommerce-ac.php:2497
1170
  msgid "Email Sending Settings"
1171
  msgstr ""
1172
 
1173
- #: woocommerce-ac.php:2547
1174
  msgid "The list below shows all Abandoned Carts which have remained in cart for a time higher than the \"Cart abandoned cut-off time\" setting."
1175
  msgstr ""
1176
 
1177
- #: woocommerce-ac.php:2589
1178
  msgid "All "
1179
  msgstr ""
1180
 
1181
  #. translators: Users.
1182
- #: woocommerce-ac.php:2594
1183
  msgid "Registered %s"
1184
  msgstr ""
1185
 
1186
  #. translators: Users.
1187
- #: woocommerce-ac.php:2600
1188
  msgid "Guest %s"
1189
  msgstr ""
1190
 
1191
- #: woocommerce-ac.php:2606
1192
  msgid "Carts without Customer Details"
1193
  msgstr ""
1194
 
1195
- #: woocommerce-ac.php:2627
1196
  msgid "Add email templates at different intervals to maximize the possibility of recovering your abandoned carts."
1197
  msgstr ""
1198
 
1199
- #: woocommerce-ac.php:2747
1200
  msgid "The Email Template has been successfully added. In order to start sending this email to your customers, please activate it."
1201
  msgstr ""
1202
 
1203
- #: woocommerce-ac.php:2757
1204
  msgid "There was a problem adding the email template. Please contact the plugin author via <a href= \"https://wordpress.org/support/plugin/woocommerce-abandoned-cart\">support forum</a>."
1205
  msgstr ""
1206
 
1207
- #: woocommerce-ac.php:2769
1208
  msgid "The Email Template has been successfully updated."
1209
  msgstr ""
1210
 
1211
- #: woocommerce-ac.php:2779
1212
  msgid "There was a problem updating the email template. Please contact the plugin author via <a href= \"https://wordpress.org/support/plugin/woocommerce-abandoned-cart\">support forum</a>."
1213
  msgstr ""
1214
 
1215
- #: woocommerce-ac.php:2788
1216
  msgid "Add New Template"
1217
  msgstr ""
1218
 
1219
- #: woocommerce-ac.php:2860
1220
  msgid "The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers."
1221
  msgstr ""
1222
 
1223
- #: woocommerce-ac.php:2911
1224
  msgid "Start Date:"
1225
  msgstr ""
1226
 
1227
- #: woocommerce-ac.php:2913
1228
  msgid "End Date:"
1229
  msgstr ""
1230
 
1231
  #. translators: Abandoned & recovered numbers and order totals.
1232
- #: woocommerce-ac.php:2933
1233
  msgid "During the selected range <strong>%1$d</strong> carts totaling <strong>%2$s</strong> were abandoned. We were able to recover <strong>%3$d</strong> of them, which led to an extra <strong>%4$s</strong>"
1234
  msgstr ""
1235
 
1236
  #. translators: Abandoned Order ID.
1237
- #: woocommerce-ac.php:2958
1238
  msgid "Abandoned Order #%s Details"
1239
  msgstr ""
1240
 
1241
- #: woocommerce-ac.php:2966
1242
  msgid "Line Total"
1243
  msgstr ""
1244
 
1245
- #: woocommerce-ac.php:3191
1246
  msgid "Customer Details"
1247
  msgstr ""
1248
 
1249
- #: woocommerce-ac.php:3195
1250
  msgid "Billing Details"
1251
  msgstr ""
1252
 
1253
- #: woocommerce-ac.php:3196
1254
  msgid "Name:"
1255
  msgstr ""
1256
 
1257
- #: woocommerce-ac.php:3199
1258
- #: woocommerce-ac.php:3220
1259
  msgid "Address:"
1260
  msgstr ""
1261
 
1262
- #: woocommerce-ac.php:3210
1263
  msgid "Email:"
1264
  msgstr ""
1265
 
1266
- #: woocommerce-ac.php:3214
1267
  msgid "Phone:"
1268
  msgstr ""
1269
 
1270
- #: woocommerce-ac.php:3219
1271
  msgid "Shipping Details"
1272
  msgstr ""
1273
 
1274
- #: woocommerce-ac.php:3229
1275
  msgid "Shipping Address same as Billing Address"
1276
  msgstr ""
1277
 
1278
- #: woocommerce-ac.php:3242
1279
  msgid "Shipping Charges"
1280
  msgstr ""
1281
 
1282
- #: woocommerce-ac.php:3326
1283
  msgid "Template Name:"
1284
  msgstr ""
1285
 
1286
- #: woocommerce-ac.php:3336
1287
  msgid "Enter a template name for reference"
1288
  msgstr ""
1289
 
1290
- #: woocommerce-ac.php:3342
1291
  msgid "Subject:"
1292
  msgstr ""
1293
 
1294
- #: woocommerce-ac.php:3352
1295
  msgid "Enter the subject that should appear in the email sent"
1296
  msgstr ""
1297
 
1298
- #: woocommerce-ac.php:3358
1299
  msgid "Email Body:"
1300
  msgstr ""
1301
 
1302
- #: woocommerce-ac.php:3385
1303
  msgid "Message to be sent in the reminder email."
1304
  msgstr ""
1305
 
1306
- #: woocommerce-ac.php:3412
1307
  msgid "Use WooCommerce Template Style:"
1308
  msgstr ""
1309
 
1310
- #: woocommerce-ac.php:3435
1311
  msgid "Email Template Header Text: "
1312
  msgstr ""
1313
 
1314
- #: woocommerce-ac.php:3450
1315
  msgid "Enter the header which will appear in the abandoned WooCommerce email sent. This is only applicable when only used when \"Use WooCommerce Template Style:\" is checked."
1316
  msgstr ""
1317
 
1318
- #: woocommerce-ac.php:3456
1319
  msgid "Send this email:"
1320
  msgstr ""
1321
 
1322
- #: woocommerce-ac.php:3498
1323
  msgid "after cart is abandoned."
1324
  msgstr ""
1325
 
1326
- #: woocommerce-ac.php:3505
1327
  msgid "Send a test email to:"
1328
  msgstr ""
1329
 
1330
- #: woocommerce-ac.php:3514
1331
  msgid "Enter the email id to which the test email needs to be sent."
1332
  msgstr ""
1333
 
1334
- #: woocommerce-ac.php:3528
1335
  msgid "Update Changes"
1336
  msgstr ""
1337
 
1338
- #: woocommerce-ac.php:3554
1339
  msgid "If you love <strong>Abandoned Cart Lite for WooCommerce</strong>, then please leave us a <a href=\"https://wordpress.org/support/plugin/woocommerce-abandoned-cart/reviews/?rate=5#new-post\" target=\"_blank\" class=\"ac-rating-link\" data-rated=\"Thanks :)\">★★★★★</a> rating. Thank you in advance. :)"
1340
  msgstr ""
1341
 
1342
- #: woocommerce-ac.php:3606
1343
  msgid "Please enter a valid email."
1344
  msgstr ""
1345
 
1346
- #: woocommerce-ac.php:3792
1347
- #: woocommerce-ac.php:3827
1348
  msgid "Men's Formal Shoes"
1349
  msgstr ""
1350
 
1351
- #: woocommerce-ac.php:3799
1352
- #: woocommerce-ac.php:3834
1353
  msgid "Woman's Hand Bags"
1354
  msgstr ""
2
  # This file is distributed under the same license as the Abandoned Cart Lite for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Abandoned Cart Lite for WooCommerce 5.11.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-abandoned-cart\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-11-02T05:33:53+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woocommerce-abandoned-cart\n"
16
 
17
  #. Plugin Name of the plugin
34
  msgid "http://www.tychesoftwares.com/"
35
  msgstr ""
36
 
37
+ #: cron/class-wcal-cron.php:95
38
  msgid "Abandoned cart reminder"
39
  msgstr ""
40
 
41
+ #: cron/class-wcal-cron.php:306
42
+ #: woocommerce-ac.php:3068
43
+ #: woocommerce-ac.php:3890
44
+ #: woocommerce-ac.php:3925
45
  msgid "Quantity"
46
  msgstr ""
47
 
48
+ #: cron/class-wcal-cron.php:307
49
+ #: woocommerce-ac.php:3891
50
+ #: woocommerce-ac.php:3926
51
  msgid "Price"
52
  msgstr ""
53
 
54
+ #: cron/class-wcal-cron.php:308
55
+ #: woocommerce-ac.php:3069
56
+ #: woocommerce-ac.php:3892
57
+ #: woocommerce-ac.php:3927
58
  msgid "Line Subtotal"
59
  msgstr ""
60
 
 
61
  #: cron/class-wcal-cron.php:313
62
+ #: cron/class-wcal-cron.php:324
63
+ #: woocommerce-ac.php:3886
64
+ #: woocommerce-ac.php:3920
65
  msgid "Your Shopping Cart"
66
  msgstr ""
67
 
 
68
  #: cron/class-wcal-cron.php:315
69
+ #: cron/class-wcal-cron.php:326
70
+ #: woocommerce-ac.php:3066
71
+ #: woocommerce-ac.php:3888
72
+ #: woocommerce-ac.php:3923
73
  msgid "Item"
74
  msgstr ""
75
 
 
76
  #: cron/class-wcal-cron.php:316
77
+ #: cron/class-wcal-cron.php:327
78
+ #: woocommerce-ac.php:3067
79
+ #: woocommerce-ac.php:3889
80
+ #: woocommerce-ac.php:3924
81
  msgid "Name"
82
  msgstr ""
83
 
84
+ #: cron/class-wcal-cron.php:350
85
+ #: cron/class-wcal-cron.php:382
86
  msgid "SKU: "
87
  msgstr ""
88
 
89
+ #: cron/class-wcal-cron.php:433
90
+ #: woocommerce-ac.php:3912
91
+ #: woocommerce-ac.php:3947
92
  msgid "Cart Total:"
93
  msgstr ""
94
 
95
+ #: cron/class-wcal-cron.php:445
96
  msgid "Product no longer exists"
97
  msgstr ""
98
 
99
+ #: cron/class-wcal-cron.php:660
100
+ #: cron/class-wcal-cron.php:729
101
  #: includes/frontend/class-wcal-checkout-process.php:220
102
  #: includes/frontend/class-wcal-checkout-process.php:557
103
  msgid "This order was abandoned & subsequently recovered."
132
  msgstr ""
133
 
134
  #: includes/admin/class-wcal-personal-data-export.php:137
135
+ #: woocommerce-ac.php:1295
136
  msgid "Abandoned Carts"
137
  msgstr ""
138
 
198
 
199
  #: includes/admin/class-wcap-add-cart-popup-modal.php:84
200
  #: includes/admin/class-wcap-pro-settings.php:66
201
+ #: includes/admin/class-wcap-pro-settings.php:359
202
+ #: woocommerce-ac.php:3636
203
  msgid "Save Changes"
204
  msgstr ""
205
 
273
  msgstr ""
274
 
275
  #: includes/admin/class-wcap-add-cart-popup-modal.php:393
276
+ #: views/wcal-email-coupon.php:61
277
  msgid "Discount Type:"
278
  msgstr ""
279
 
434
  msgid "Enter DeBounce JS API Key."
435
  msgstr ""
436
 
437
+ #: includes/admin/class-wcap-pro-settings.php:241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
438
  msgid "Product Image( H x W )"
439
  msgstr ""
440
 
441
+ #: includes/admin/class-wcap-pro-settings.php:245
442
  msgid "This setting affects the dimension of the product image in the abandoned cart reminder email."
443
  msgstr ""
444
 
445
+ #: includes/admin/class-wcap-pro-settings.php:269
446
  msgid "Setting for sending Emails & SMS using Action Scheduler"
447
  msgstr ""
448
 
449
+ #: includes/admin/class-wcap-pro-settings.php:276
450
  msgid "Send Abandoned cart emails automatically using Action Scheduler"
451
  msgstr ""
452
 
453
+ #: includes/admin/class-wcap-pro-settings.php:280
454
  msgid "Enabling this setting will send the abandoned cart reminder emails to the customer after the set time. If disabled, abandoned cart reminder emails will not be sent using the Action Scheduler. You will need to set cron job manually from cPanel. If you are unsure how to set the cron job, please <a href= mailto:support@tychesoftwares.com>contact us</a> for it."
455
  msgstr ""
456
 
457
+ #: includes/admin/class-wcap-pro-settings.php:285
458
  msgid "Run automated Scheduler every X minutes"
459
  msgstr ""
460
 
461
+ #: includes/admin/class-wcap-pro-settings.php:289
462
  msgid "The duration in minutes after which an action should be automatically scheduled to send email, SMS & FB reminders to customers."
463
  msgstr ""
464
 
465
+ #: includes/admin/class-wcap-pro-settings.php:294
466
  msgid "Rules to exclude capturing abandoned carts"
467
  msgstr ""
468
 
469
+ #: includes/admin/class-wcap-pro-settings.php:301
470
  msgid "Do not capture abandoned carts for these IP addresses"
471
  msgstr ""
472
 
473
+ #: includes/admin/class-wcap-pro-settings.php:305
474
  msgid "The carts abandoned from these IP addresses will not be tracked by the plugin. Accepts wildcards, e.g <code>192.168.*</code> will block all IP addresses which starts from \"192.168\". <i>Separate IP addresses with commas.</i>"
475
  msgstr ""
476
 
477
+ #: includes/admin/class-wcap-pro-settings.php:310
478
  msgid "Do not capture abandoned carts for these email addresses"
479
  msgstr ""
480
 
481
+ #: includes/admin/class-wcap-pro-settings.php:314
482
  msgid "The carts abandoned using these email addresses will not be tracked by the plugin. <i>Separate email addresses with commas.</i>"
483
  msgstr ""
484
 
485
+ #: includes/admin/class-wcap-pro-settings.php:319
486
  msgid "Do not capture abandoned carts for email addresses from these domains"
487
  msgstr ""
488
 
489
+ #: includes/admin/class-wcap-pro-settings.php:323
490
  msgid "The carts abandoned from email addresses with these domains will not be tracked by the plugin. <i>Separate email address domains with commas.</i>"
491
  msgstr ""
492
 
493
+ #: includes/admin/class-wcap-pro-settings.php:328
494
  msgid "Unsubscribe Settings"
495
  msgstr ""
496
 
497
+ #: includes/admin/class-wcap-pro-settings.php:336
498
  msgid "Unsubscribe Landing Page"
499
  msgstr ""
500
 
501
+ #: includes/admin/class-wcap-pro-settings.php:365
502
  msgid "Send Test SMS"
503
  msgstr ""
504
 
505
+ #: includes/admin/class-wcap-pro-settings.php:369
506
  msgid "Recipient"
507
  msgstr ""
508
 
509
+ #: includes/admin/class-wcap-pro-settings.php:372
510
  msgid "Must be a valid phone number in E.164 format."
511
  msgstr ""
512
 
513
+ #: includes/admin/class-wcap-pro-settings.php:377
514
  msgid "Message"
515
  msgstr ""
516
 
517
+ #: includes/admin/class-wcap-pro-settings.php:378
518
  msgid "Hello World!"
519
  msgstr ""
520
 
521
+ #: includes/admin/class-wcap-pro-settings.php:400
522
  msgid "Twilio"
523
  msgstr ""
524
 
525
+ #: includes/admin/class-wcap-pro-settings.php:407
526
  msgid "Enable SMS"
527
  msgstr ""
528
 
529
+ #: includes/admin/class-wcap-pro-settings.php:411
530
  msgid "<i>Enable the ability to send reminder SMS for abandoned carts.</i>"
531
  msgstr ""
532
 
533
+ #: includes/admin/class-wcap-pro-settings.php:416
534
  msgid "From"
535
  msgstr ""
536
 
537
+ #: includes/admin/class-wcap-pro-settings.php:420
538
  msgid "<i>Must be a Twilio phone number (in E.164 format) or alphanumeric sender ID.</i>"
539
  msgstr ""
540
 
541
+ #: includes/admin/class-wcap-pro-settings.php:425
542
  msgid "Account SID"
543
  msgstr ""
544
 
545
+ #: includes/admin/class-wcap-pro-settings.php:434
546
  msgid "Auth Token"
547
  msgstr ""
548
 
549
+ #: includes/admin/class-wcap-pro-settings.php:463
550
  msgid "Facebook Messenger Settings"
551
  msgstr ""
552
 
553
+ #: includes/admin/class-wcap-pro-settings.php:470
554
  msgid "Enable Facebook Messenger Reminders"
555
  msgstr ""
556
 
557
+ #: includes/admin/class-wcap-pro-settings.php:474
558
  msgid "<i>This option will display a checkbox after the Add to cart button for user consent to connect with Facebook.</i>"
559
  msgstr ""
560
 
561
+ #: includes/admin/class-wcap-pro-settings.php:479
562
  msgid "Facebook Messenger on Add to Cart Pop-up modal"
563
  msgstr ""
564
 
565
+ #: includes/admin/class-wcap-pro-settings.php:483
566
  msgid "<i>This option will display a checkbox on the pop-up modal to connect with Facebook.</i>"
567
  msgstr ""
568
 
569
+ #: includes/admin/class-wcap-pro-settings.php:488
570
  msgid "Icon size of user"
571
  msgstr ""
572
 
573
+ #: includes/admin/class-wcap-pro-settings.php:493
574
  msgid "<i>Select the size of user icon which shall be displayed below the checkbox in case the user is logged in.</i>"
575
  msgstr ""
576
 
577
+ #: includes/admin/class-wcap-pro-settings.php:496
578
  msgid "Small"
579
  msgstr ""
580
 
581
+ #: includes/admin/class-wcap-pro-settings.php:497
582
  msgid "Medium"
583
  msgstr ""
584
 
585
+ #: includes/admin/class-wcap-pro-settings.php:498
586
  msgid "Large"
587
  msgstr ""
588
 
589
+ #: includes/admin/class-wcap-pro-settings.php:499
590
  msgid "Standard"
591
  msgstr ""
592
 
593
+ #: includes/admin/class-wcap-pro-settings.php:500
594
  msgid "Extra Large"
595
  msgstr ""
596
 
597
+ #: includes/admin/class-wcap-pro-settings.php:507
598
  msgid "Consent text"
599
  msgstr ""
600
 
601
+ #: includes/admin/class-wcap-pro-settings.php:511
602
  msgid "<i>Text that will appear above the consent checkbox. HTML tags are also allowed.</i>"
603
  msgstr ""
604
 
605
+ #: includes/admin/class-wcap-pro-settings.php:516
606
  msgid "Facebook Page ID"
607
  msgstr ""
608
 
609
+ #: includes/admin/class-wcap-pro-settings.php:520
610
  msgid "<i>Facebook Page ID in numberic format. You can find your page ID from <a href='https://www.tychesoftwares.com/docs/docs/abandoned-cart-pro-for-woocommerce/send-abandoned-cart-reminder-notifications-using-facebook-messenger#fbpageid' target='_blank'>here</a></i>"
611
  msgstr ""
612
 
613
+ #: includes/admin/class-wcap-pro-settings.php:525
614
  msgid "Messenger App ID"
615
  msgstr ""
616
 
617
+ #: includes/admin/class-wcap-pro-settings.php:529
618
  msgid "<i>Enter your Messenger App ID</i>"
619
  msgstr ""
620
 
621
+ #: includes/admin/class-wcap-pro-settings.php:534
622
  msgid "Facebook Page Token"
623
  msgstr ""
624
 
625
+ #: includes/admin/class-wcap-pro-settings.php:538
626
  msgid "<i>Enter your Facebook Page Token</i>"
627
  msgstr ""
628
 
629
+ #: includes/admin/class-wcap-pro-settings.php:543
630
  msgid "Verify Token"
631
  msgstr ""
632
 
633
+ #: includes/admin/class-wcap-pro-settings.php:547
634
  msgid "<i>Enter your Verify Token</i>"
635
  msgstr ""
636
 
807
  msgstr ""
808
 
809
  #: includes/classes/class-wcal-dashboard-report.php:161
810
+ #: woocommerce-ac.php:2137
811
  msgid "Abandoned Orders"
812
  msgstr ""
813
 
872
  msgstr ""
873
 
874
  #: includes/classes/class-wcal-dashboard-report.php:319
875
+ #: woocommerce-ac.php:3019
876
  msgid "Go"
877
  msgstr ""
878
 
965
  msgid "<b><i>Upgrade to <a href='%s' target='_blank'>Abandoned Cart Pro for WooCommerce</a> to enable the feature.</i></b>"
966
  msgstr ""
967
 
968
+ #: views/wcal-email-coupon.php:24
969
+ msgid "Generate unique coupon codes:"
970
+ msgstr ""
971
+
972
+ #: views/wcal-email-coupon.php:77
973
+ msgid "Percentage discount"
974
+ msgstr ""
975
+
976
+ #: views/wcal-email-coupon.php:78
977
+ msgid "Fixed cart discount"
978
+ msgstr ""
979
+
980
+ #: views/wcal-email-coupon.php:85
981
+ msgid "Coupon amount:"
982
+ msgstr ""
983
+
984
+ #: views/wcal-email-coupon.php:108
985
+ msgid "Allow free shipping:"
986
+ msgstr ""
987
+
988
+ #: views/wcal-email-coupon.php:126
989
+ msgid "Check this box if the coupon grants free shipping. A free shipping method must be enabled in your shipping zone and be set to require \"a valid free shipping coupon\" (see the \"Free Shipping Requires\" setting)."
990
+ msgstr ""
991
+
992
+ #: views/wcal-email-coupon.php:134
993
+ msgid "Coupon validity:"
994
+ msgstr ""
995
+
996
+ #: views/wcal-email-coupon.php:170
997
+ msgid "The coupon code which will be sent in the reminder emails will be expired based the validity set here. E.g if the coupon code sent in the reminder email should be expired after 7 days then set 7 Day(s) for this option."
998
+ msgstr ""
999
+
1000
+ #: views/wcal-email-coupon.php:177
1001
+ msgid "Individual use only:"
1002
+ msgstr ""
1003
+
1004
+ #: views/wcal-email-coupon.php:201
1005
+ msgid "OR"
1006
+ msgstr ""
1007
+
1008
+ #: views/wcal-email-coupon.php:205
1009
+ msgid "Enter a coupon code to add into email:"
1010
+ msgstr ""
1011
+
1012
+ #: views/wcal-email-coupon.php:261
1013
+ msgid "Search & select one coupon code that customers should use to get a discount. Generated coupon code which will be sent in email reminder will have the settings of coupon selected in this option."
1014
+ msgstr ""
1015
+
1016
+ #: woocommerce-ac.php:305
1017
+ #: woocommerce-ac.php:751
1018
+ #: woocommerce-ac.php:2151
1019
  msgid "Settings"
1020
  msgstr ""
1021
 
1022
+ #: woocommerce-ac.php:334
1023
  msgid "Emails are not being sent to customers."
1024
  msgstr ""
1025
 
1026
+ #: woocommerce-ac.php:340
1027
  msgid "Capturing of cart and other information was not satisfactory."
1028
  msgstr ""
1029
 
1030
+ #: woocommerce-ac.php:346
1031
  msgid "I cannot see abandoned cart reminder emails records."
1032
  msgstr ""
1033
 
1034
+ #: woocommerce-ac.php:352
1035
  msgid "I want to upgrade the plugin to the PRO version."
1036
  msgstr ""
1037
 
1038
+ #: woocommerce-ac.php:475
1039
  msgid "HTML Email Template"
1040
  msgstr ""
1041
 
1042
+ #: woocommerce-ac.php:481
1043
  msgid "Abandoned cart Email Template"
1044
  msgstr ""
1045
 
1046
+ #: woocommerce-ac.php:758
1047
  msgid "Enable abandoned cart emails"
1048
  msgstr ""
1049
 
1050
+ #: woocommerce-ac.php:762
1051
  msgid "Yes, enable the abandoned cart emails."
1052
  msgstr ""
1053
 
1054
+ #: woocommerce-ac.php:767
1055
  msgid "Cart abandoned cut-off time"
1056
  msgstr ""
1057
 
1058
+ #: woocommerce-ac.php:771
1059
  msgid "Consider cart abandoned after X minutes of item being added to cart & order not placed."
1060
  msgstr ""
1061
 
1062
+ #: woocommerce-ac.php:776
1063
  msgid "Automatically Delete Abandoned Orders after X days"
1064
  msgstr ""
1065
 
1066
+ #: woocommerce-ac.php:780
1067
  msgid "Automatically delete abandoned cart orders after X days."
1068
  msgstr ""
1069
 
1070
+ #: woocommerce-ac.php:785
1071
  msgid "Email admin On Order Recovery"
1072
  msgstr ""
1073
 
1074
+ #: woocommerce-ac.php:789
1075
  msgid "Sends email to Admin if an Abandoned Cart Order is recovered."
1076
  msgstr ""
1077
 
1078
+ #: woocommerce-ac.php:794
1079
  msgid "Start tracking from Cart Page"
1080
  msgstr ""
1081
 
1082
+ #: woocommerce-ac.php:798
1083
  msgid "Enable tracking of abandoned products & carts even if customer does not visit the checkout page or does not enter any details on the checkout page like Name or Email. Tracking will begin as soon as a visitor adds a product to their cart and visits the cart page."
1084
  msgstr ""
1085
 
1086
+ #: woocommerce-ac.php:803
1087
  msgid "Message to be displayed for Guest users when tracking their carts"
1088
  msgstr ""
1089
 
1090
+ #: woocommerce-ac.php:807
1091
  msgid "<br>In compliance with GDPR, add a message on the Checkout page to inform Guest users of how their data is being used.<br><i>For example: Your email address will help us support your shopping experience throughout the site. Please check our Privacy Policy to see how we use your personal data.</i>"
1092
  msgstr ""
1093
 
1094
+ #: woocommerce-ac.php:812
1095
  msgid "Message to be displayed for registered users when tracking their carts."
1096
  msgstr ""
1097
 
1098
+ #: woocommerce-ac.php:816
1099
  msgid "<br>In compliance with GDPR, add a message on the Shop & Product pages to inform Registered users of how their data is being used.<br><i>For example: Please check our Privacy Policy to see how we use your personal data.</i>"
1100
  msgstr ""
1101
 
1102
+ #: woocommerce-ac.php:821
1103
  msgid "Allow the visitor to opt out of cart tracking."
1104
  msgstr ""
1105
 
1106
+ #: woocommerce-ac.php:825
1107
  msgid "<br>In compliance with GDPR, allow the site visitor (guests & registered users) to opt out from cart tracking. This message will be displayed in conjunction with the GDPR message above.</i>"
1108
  msgstr ""
1109
 
1110
+ #: woocommerce-ac.php:830
1111
  msgid "Message to be displayed when the user chooses to opt out of cart tracking."
1112
  msgstr ""
1113
 
1114
+ #: woocommerce-ac.php:834
1115
  msgid "<br>Message to be displayed when the user chooses to opt out of cart tracking.</i>"
1116
  msgstr ""
1117
 
1118
+ #: woocommerce-ac.php:838
1119
+ msgid "Delete Coupons Automatically"
1120
+ msgstr ""
1121
+
1122
+ #: woocommerce-ac.php:842
1123
+ msgid "Enable this setting if you want to completely remove the expired and used coupon code automatically every 15 days."
1124
+ msgstr ""
1125
+
1126
+ #: woocommerce-ac.php:846
1127
+ msgid "Delete Coupons Manually"
1128
+ msgstr ""
1129
+
1130
+ #: woocommerce-ac.php:850
1131
+ msgid "If you want to completely remove the expired and used coupon code now then click on \"Delete\" button."
1132
+ msgstr ""
1133
+
1134
+ #: woocommerce-ac.php:859
1135
  msgid "Settings for abandoned cart recovery emails"
1136
  msgstr ""
1137
 
1138
+ #: woocommerce-ac.php:866
1139
  msgid "\"From\" Name"
1140
  msgstr ""
1141
 
1142
+ #: woocommerce-ac.php:875
1143
  msgid "\"From\" Address"
1144
  msgstr ""
1145
 
1146
+ #: woocommerce-ac.php:884
1147
  msgid "Send Reply Emails to"
1148
  msgstr ""
1149
 
1150
+ #: woocommerce-ac.php:893
1151
+ msgid "UTM parameters to be added to all the links in reminder emails"
1152
+ msgstr ""
1153
+
1154
+ #: woocommerce-ac.php:897
1155
+ msgid "UTM parameters that should be added to all the links in reminder emails."
1156
+ msgstr ""
1157
+
1158
+ #: woocommerce-ac.php:1034
1159
  msgid "Abandoned cart cut off time should be numeric and has to be greater than 0."
1160
  msgstr ""
1161
 
1162
+ #: woocommerce-ac.php:1051
1163
  msgid "Automatically Delete Abandoned Orders after X days has to be greater than 0."
1164
  msgstr ""
1165
 
1166
+ #: woocommerce-ac.php:2130
1167
  msgid "Dashboard"
1168
  msgstr ""
1169
 
1170
+ #: woocommerce-ac.php:2144
1171
  msgid "Email Templates"
1172
  msgstr ""
1173
 
1174
+ #: woocommerce-ac.php:2158
1175
  msgid "Recovered Orders"
1176
  msgstr ""
1177
 
1178
+ #: woocommerce-ac.php:2165
1179
  msgid "Product Report"
1180
  msgstr ""
1181
 
1182
+ #: woocommerce-ac.php:2442
1183
  msgid "You do not have sufficient permissions to access this page."
1184
  msgstr ""
1185
 
1186
+ #: woocommerce-ac.php:2446
1187
  msgid "WooCommerce - Abandon Cart Lite"
1188
  msgstr ""
1189
 
1190
+ #: woocommerce-ac.php:2518
1191
  msgid "The Abandoned cart has been successfully deleted."
1192
  msgstr ""
1193
 
1194
+ #: woocommerce-ac.php:2520
1195
  msgid "All Abandoned Carts have been successfully deleted."
1196
  msgstr ""
1197
 
1198
+ #: woocommerce-ac.php:2522
1199
  msgid "All Visitor carts have been successfully deleted."
1200
  msgstr ""
1201
 
1202
+ #: woocommerce-ac.php:2524
1203
  msgid "All Guest carts have been successfully deleted."
1204
  msgstr ""
1205
 
1206
+ #: woocommerce-ac.php:2526
1207
  msgid "All Registered carts have been deleted."
1208
  msgstr ""
1209
 
1210
+ #: woocommerce-ac.php:2537
1211
  msgid "The Template has been successfully deleted."
1212
  msgstr ""
1213
 
1214
+ #: woocommerce-ac.php:2544
1215
  msgid "Change settings for sending email notifications to Customers, to Admin etc."
1216
  msgstr ""
1217
 
1218
+ #: woocommerce-ac.php:2578
1219
  msgid "General Settings"
1220
  msgstr ""
1221
 
1222
+ #: woocommerce-ac.php:2581
1223
  msgid "Email Sending Settings"
1224
  msgstr ""
1225
 
1226
+ #: woocommerce-ac.php:2631
1227
  msgid "The list below shows all Abandoned Carts which have remained in cart for a time higher than the \"Cart abandoned cut-off time\" setting."
1228
  msgstr ""
1229
 
1230
+ #: woocommerce-ac.php:2673
1231
  msgid "All "
1232
  msgstr ""
1233
 
1234
  #. translators: Users.
1235
+ #: woocommerce-ac.php:2678
1236
  msgid "Registered %s"
1237
  msgstr ""
1238
 
1239
  #. translators: Users.
1240
+ #: woocommerce-ac.php:2684
1241
  msgid "Guest %s"
1242
  msgstr ""
1243
 
1244
+ #: woocommerce-ac.php:2690
1245
  msgid "Carts without Customer Details"
1246
  msgstr ""
1247
 
1248
+ #: woocommerce-ac.php:2711
1249
  msgid "Add email templates at different intervals to maximize the possibility of recovering your abandoned carts."
1250
  msgstr ""
1251
 
1252
+ #: woocommerce-ac.php:2851
1253
  msgid "The Email Template has been successfully added. In order to start sending this email to your customers, please activate it."
1254
  msgstr ""
1255
 
1256
+ #: woocommerce-ac.php:2861
1257
  msgid "There was a problem adding the email template. Please contact the plugin author via <a href= \"https://wordpress.org/support/plugin/woocommerce-abandoned-cart\">support forum</a>."
1258
  msgstr ""
1259
 
1260
+ #: woocommerce-ac.php:2873
1261
  msgid "The Email Template has been successfully updated."
1262
  msgstr ""
1263
 
1264
+ #: woocommerce-ac.php:2883
1265
  msgid "There was a problem updating the email template. Please contact the plugin author via <a href= \"https://wordpress.org/support/plugin/woocommerce-abandoned-cart\">support forum</a>."
1266
  msgstr ""
1267
 
1268
+ #: woocommerce-ac.php:2892
1269
  msgid "Add New Template"
1270
  msgstr ""
1271
 
1272
+ #: woocommerce-ac.php:2964
1273
  msgid "The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers."
1274
  msgstr ""
1275
 
1276
+ #: woocommerce-ac.php:3015
1277
  msgid "Start Date:"
1278
  msgstr ""
1279
 
1280
+ #: woocommerce-ac.php:3017
1281
  msgid "End Date:"
1282
  msgstr ""
1283
 
1284
  #. translators: Abandoned & recovered numbers and order totals.
1285
+ #: woocommerce-ac.php:3037
1286
  msgid "During the selected range <strong>%1$d</strong> carts totaling <strong>%2$s</strong> were abandoned. We were able to recover <strong>%3$d</strong> of them, which led to an extra <strong>%4$s</strong>"
1287
  msgstr ""
1288
 
1289
  #. translators: Abandoned Order ID.
1290
+ #: woocommerce-ac.php:3062
1291
  msgid "Abandoned Order #%s Details"
1292
  msgstr ""
1293
 
1294
+ #: woocommerce-ac.php:3070
1295
  msgid "Line Total"
1296
  msgstr ""
1297
 
1298
+ #: woocommerce-ac.php:3295
1299
  msgid "Customer Details"
1300
  msgstr ""
1301
 
1302
+ #: woocommerce-ac.php:3299
1303
  msgid "Billing Details"
1304
  msgstr ""
1305
 
1306
+ #: woocommerce-ac.php:3300
1307
  msgid "Name:"
1308
  msgstr ""
1309
 
1310
+ #: woocommerce-ac.php:3303
1311
+ #: woocommerce-ac.php:3324
1312
  msgid "Address:"
1313
  msgstr ""
1314
 
1315
+ #: woocommerce-ac.php:3314
1316
  msgid "Email:"
1317
  msgstr ""
1318
 
1319
+ #: woocommerce-ac.php:3318
1320
  msgid "Phone:"
1321
  msgstr ""
1322
 
1323
+ #: woocommerce-ac.php:3323
1324
  msgid "Shipping Details"
1325
  msgstr ""
1326
 
1327
+ #: woocommerce-ac.php:3333
1328
  msgid "Shipping Address same as Billing Address"
1329
  msgstr ""
1330
 
1331
+ #: woocommerce-ac.php:3346
1332
  msgid "Shipping Charges"
1333
  msgstr ""
1334
 
1335
+ #: woocommerce-ac.php:3430
1336
  msgid "Template Name:"
1337
  msgstr ""
1338
 
1339
+ #: woocommerce-ac.php:3440
1340
  msgid "Enter a template name for reference"
1341
  msgstr ""
1342
 
1343
+ #: woocommerce-ac.php:3446
1344
  msgid "Subject:"
1345
  msgstr ""
1346
 
1347
+ #: woocommerce-ac.php:3456
1348
  msgid "Enter the subject that should appear in the email sent"
1349
  msgstr ""
1350
 
1351
+ #: woocommerce-ac.php:3462
1352
  msgid "Email Body:"
1353
  msgstr ""
1354
 
1355
+ #: woocommerce-ac.php:3489
1356
  msgid "Message to be sent in the reminder email."
1357
  msgstr ""
1358
 
1359
+ #: woocommerce-ac.php:3516
1360
  msgid "Use WooCommerce Template Style:"
1361
  msgstr ""
1362
 
1363
+ #: woocommerce-ac.php:3539
1364
  msgid "Email Template Header Text: "
1365
  msgstr ""
1366
 
1367
+ #: woocommerce-ac.php:3554
1368
  msgid "Enter the header which will appear in the abandoned WooCommerce email sent. This is only applicable when only used when \"Use WooCommerce Template Style:\" is checked."
1369
  msgstr ""
1370
 
1371
+ #: woocommerce-ac.php:3560
1372
  msgid "Send this email:"
1373
  msgstr ""
1374
 
1375
+ #: woocommerce-ac.php:3602
1376
  msgid "after cart is abandoned."
1377
  msgstr ""
1378
 
1379
+ #: woocommerce-ac.php:3609
1380
  msgid "Send a test email to:"
1381
  msgstr ""
1382
 
1383
+ #: woocommerce-ac.php:3618
1384
  msgid "Enter the email id to which the test email needs to be sent."
1385
  msgstr ""
1386
 
1387
+ #: woocommerce-ac.php:3632
1388
  msgid "Update Changes"
1389
  msgstr ""
1390
 
1391
+ #: woocommerce-ac.php:3658
1392
  msgid "If you love <strong>Abandoned Cart Lite for WooCommerce</strong>, then please leave us a <a href=\"https://wordpress.org/support/plugin/woocommerce-abandoned-cart/reviews/?rate=5#new-post\" target=\"_blank\" class=\"ac-rating-link\" data-rated=\"Thanks :)\">★★★★★</a> rating. Thank you in advance. :)"
1393
  msgstr ""
1394
 
1395
+ #: woocommerce-ac.php:3710
1396
  msgid "Please enter a valid email."
1397
  msgstr ""
1398
 
1399
+ #: woocommerce-ac.php:3896
1400
+ #: woocommerce-ac.php:3931
1401
  msgid "Men's Formal Shoes"
1402
  msgstr ""
1403
 
1404
+ #: woocommerce-ac.php:3903
1405
+ #: woocommerce-ac.php:3938
1406
  msgid "Woman's Hand Bags"
1407
  msgstr ""
includes/admin/class-wcap-pro-settings-callbacks.php CHANGED
@@ -533,45 +533,6 @@ if ( ! class_exists( 'WCAP_Pro_Settings_Callbacks' ) ) {
533
  $html = '<label for="wcap_restrict_domain_address_label"> ' . $args[0] . '</label>';
534
  echo wp_kses_post( $html );
535
  }
536
-
537
- /**
538
- * Callback for Abandoned cart Coupon settings.
539
- */
540
- public static function wcap_coupon_callback() {
541
- }
542
-
543
- /**
544
- * Option for deleting the plugin data upon uninstall.
545
- *
546
- * @param array $args Argument for adding field details.
547
- * @since 8.3
548
- */
549
- public static function wcap_deleting_coupon_data( $args ) {
550
- $wcap_delete_coupon_data = get_option( 'wcap_delete_coupon_data', '' );
551
- if ( isset( $wcap_delete_coupon_data ) && '' === $wcap_delete_coupon_data ) {
552
- $wcap_delete_coupon_data = 'off';
553
- }
554
-
555
- ?>
556
- <input type="checkbox" id="wcap_delete_coupon_data" name="wcap_delete_coupon_data" value="on" <?php echo checked( 'on', $wcap_delete_coupon_data, false ); ?> readonly disabled />
557
- <?php
558
- $html = '<label for="wcap_delete_coupon_data">' . $args[0] . '</label>';
559
- echo wp_kses_post( $html );
560
- }
561
-
562
- /**
563
- * Coupon deletion manual button.
564
- *
565
- * @param array $args - Arguments for the setting.
566
- */
567
- public static function wcap_deleting_coupon_data_manually( $args ) {
568
- ?>
569
- <input type="button" class="button-secondary" id="wcap_delete_coupons" value="<?php esc_html_e( 'Delete', 'woocommerce-ac' ); ?>" readonly disabled >
570
- <?php
571
- $html = '<label>' . $args[0] . '</label>';
572
- echo wp_kses_post( $html );
573
- }
574
-
575
  /**
576
  * Callback for product name link redirect.
577
  *
533
  $html = '<label for="wcap_restrict_domain_address_label"> ' . $args[0] . '</label>';
534
  echo wp_kses_post( $html );
535
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  /**
537
  * Callback for product name link redirect.
538
  *
includes/admin/class-wcap-pro-settings.php CHANGED
@@ -176,31 +176,6 @@ if ( ! class_exists( 'WCAP_Pro_Settings' ) ) {
176
  array( __( 'Enter DeBounce JS API Key.', 'woocommerce-abandoned-cart' ) . $upgrade_pro_msg )
177
  );
178
 
179
- add_settings_section(
180
- 'ac_coupon_settings_section', // ID used to identify this section and with which to register options.
181
- __( 'Coupon Settings', 'woocommerce-abandoned-cart' ), // Title to be displayed on the administration page.
182
- array( 'WCAP_Pro_Settings_Callbacks', 'wcap_coupon_callback' ), // Callback used to render the description of the section.
183
- 'woocommerce_ac_page' // Page on which to add this section of options.
184
- );
185
-
186
- add_settings_field(
187
- 'wcap_delete_coupon_data',
188
- __( 'Delete Coupons Automatically', 'woocommerce-abandoned-cart' ),
189
- array( 'WCAP_Pro_Settings_Callbacks', 'wcap_deleting_coupon_data' ),
190
- 'woocommerce_ac_page',
191
- 'ac_coupon_settings_section',
192
- array( __( 'Enable this setting if you want to completely remove the expired and used coupon code automatically every 15 days.', 'woocommerce-abandoned-cart' ) . $upgrade_pro_msg )
193
- );
194
-
195
- add_settings_field(
196
- 'wcap_delete_coupon_data_manually',
197
- __( 'Delete Coupons Manually', 'woocommerce-abandoned-cart' ),
198
- array( 'WCAP_Pro_Settings_Callbacks', 'wcap_deleting_coupon_data_manually' ),
199
- 'woocommerce_ac_page',
200
- 'ac_coupon_settings_section',
201
- array( __( 'If you want to completely remove the expired and used coupon code now then click on "Delete" button.', 'woocommerce-abandoned-cart' ) . $upgrade_pro_msg )
202
- );
203
-
204
  register_setting(
205
  'woocommerce_ac_settings',
206
  'ac_enable_cart_emails'
176
  array( __( 'Enter DeBounce JS API Key.', 'woocommerce-abandoned-cart' ) . $upgrade_pro_msg )
177
  );
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  register_setting(
180
  'woocommerce_ac_settings',
181
  'ac_enable_cart_emails'
includes/class-wcal-common.php CHANGED
@@ -1022,4 +1022,415 @@ class wcal_common { // phpcs:ignore
1022
  $template_id => array_shift( $list_frequencies ),
1023
  );
1024
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
  }
1022
  $template_id => array_shift( $list_frequencies ),
1023
  );
1024
  }
1025
+ /**
1026
+ * Check if the template has coupon code tag and merge
1027
+ *
1028
+ * @param string $email_body_template - the content to be replaced.
1029
+ * @param object $results_template_value - the template that's being sent.
1030
+ */
1031
+ public static function wcal_check_and_replace_email_tag( $email_body_template, $results_template_value ) {
1032
+ $coupon_code_to_apply = '';
1033
+ if ( stripos( $email_body_template, '{{coupon.code}}' ) ) {
1034
+ $discount_details['discount_expiry'] = $results_template_value->discount_expiry;
1035
+ $discount_details['discount_type'] = $results_template_value->discount_type;
1036
+ $discount_details['discount_shipping'] = $results_template_value->discount_shipping;
1037
+ $discount_details['individual_use'] = $results_template_value->individual_use;
1038
+ $discount_details['discount_amount'] = $results_template_value->discount;
1039
+ $discount_details['generate_unique_code'] = $results_template_value->generate_unique_coupon_code;
1040
+ $default_template = $results_template_value->default_template;
1041
+
1042
+ $coupon_id = isset( $results_template_value->coupon_code ) ? $results_template_value->coupon_code : '';
1043
+ $coupon_code = '';
1044
+ if ( '' !== $coupon_id ) {
1045
+ $coupon_to_apply = get_post( $coupon_id, ARRAY_A );
1046
+ $coupon_code = $coupon_to_apply['post_title'];
1047
+ }
1048
+
1049
+ $coupon_code_to_apply = self::wcal_get_coupon_email( $discount_details, $coupon_code, $default_template );
1050
+ $email_body_template = str_ireplace( '{{coupon.code}}', $coupon_code_to_apply, $email_body_template );
1051
+ }
1052
+ return array( $email_body_template, $coupon_code_to_apply );
1053
+ }
1054
+ /**
1055
+ * Get the coupon which will be added in the email template.
1056
+ *
1057
+ * @param array $discount_details - Contains coupon details such as discount amount, type etc.
1058
+ * @param string $coupon_code - Parent coupon code.
1059
+ * @param int $default_template - Email template is default - 1|0.
1060
+ * @return string $coupon_code_to_apply
1061
+ * @since 8.9.0
1062
+ */
1063
+ public static function wcal_get_coupon_email( $discount_details, $coupon_code, $default_template ) {
1064
+
1065
+ $discount_expiry = $discount_details['discount_expiry'];
1066
+ $discount_expiry_explode = explode( '-', $discount_expiry );
1067
+ $expiry_date_extend = '';
1068
+ if ( '' !== $discount_expiry_explode[0] && '0' !== $discount_expiry_explode[0] ) {
1069
+ $discount_expiry = str_replace( '-', ' ', $discount_expiry );
1070
+ $discount_expiry = ' +' . $discount_expiry;
1071
+ $expiry_date_extend = strtotime( $discount_expiry );
1072
+ }
1073
+
1074
+ $coupon_post_meta = '';
1075
+ $discount_type = $discount_details['discount_type'];
1076
+ $expiry_date = apply_filters( 'wcal_coupon_expiry_date', $expiry_date_extend );
1077
+ $coupon_code_to_apply = '';
1078
+ $discount_shipping = $discount_details['discount_shipping'];
1079
+ $individual_use = '1' === $discount_details['individual_use'] ? 'yes' : 'no';
1080
+ $discount_amount = $discount_details['discount_amount'];
1081
+ $generate_unique_code = $discount_details['generate_unique_code'];
1082
+
1083
+ if ( '1' === $generate_unique_code && '' === $coupon_code ) {
1084
+ $coupon_post_meta = apply_filters( 'wcal_update_unique_coupon_post_meta_email', $coupon_code, $coupon_post_meta );
1085
+ $coupon_code_to_apply = self::wcal_wp_coupon_code( $discount_amount, $discount_type, $expiry_date, $discount_shipping, $coupon_post_meta, $individual_use );
1086
+ } else {
1087
+ $coupon_code_to_apply = $coupon_code;
1088
+ }
1089
+ return $coupon_code_to_apply;
1090
+ }
1091
+
1092
+ /**
1093
+ * It will create the unique coupon code.
1094
+ *
1095
+ * @param int $discount_amt - Discount amount.
1096
+ * @param string $get_discount_type - Discount type.
1097
+ * @param date $get_expiry_date - Expiry date.
1098
+ * @param string $discount_shipping - Shipping dicsount.
1099
+ * @param array | object $coupon_post_meta - Data of Parent coupon.
1100
+ * @param string $individual_use - Force individual use.
1101
+ * @return string $final_string 12 Digit unique coupon code name
1102
+ * @since 2.3.6
1103
+ */
1104
+ public static function wcal_wp_coupon_code( $discount_amt, $get_discount_type, $get_expiry_date, $discount_shipping = 'no', $coupon_post_meta = array(), $individual_use = 'yes' ) {
1105
+ $ten_random_string = self::wp_random_string();
1106
+ $first_two_digit = wp_rand( 0, 99 );
1107
+ $final_string = $first_two_digit . $ten_random_string;
1108
+ $datetime = $get_expiry_date;
1109
+ $coupon_code = $final_string;
1110
+ $coupon_product_categories = isset( $coupon_post_meta['product_categories'][0] ) && '' !== $coupon_post_meta['product_categories'][0] ? unserialize( $coupon_post_meta['product_categories'] [0] ) : array(); //phpcs:ignore
1111
+
1112
+ $coupon_exculde_product_categories = isset( $coupon_post_meta['exclude_product_categories'][0] ) && '' !== $coupon_post_meta['exclude_product_categories'][0] ? unserialize( $coupon_post_meta['exclude_product_categories'][0] ) : array(); //phpcs:ignore
1113
+
1114
+ $coupon_product_ids = isset( $coupon_post_meta['product_ids'][0] ) && '' !== $coupon_post_meta['product_ids'][0] ? $coupon_post_meta['product_ids'][0] : '';
1115
+
1116
+ $coupon_exclude_product_ids = isset( $coupon_post_meta['exclude_product_ids'][0] ) && '' !== $coupon_post_meta['exclude_product_ids'][0] ? $coupon_post_meta['exclude_product_ids'][0] : '';
1117
+
1118
+ $coupon_free_shipping = isset( $coupon_post_meta['free_shipping'][0] ) && '' !== $coupon_post_meta['free_shipping'][0] ? $coupon_post_meta['free_shipping'][0] : $discount_shipping;
1119
+
1120
+ $coupon_minimum_amount = isset( $coupon_post_meta['minimum_amount'][0] ) && '' !== $coupon_post_meta['minimum_amount'][0] ? $coupon_post_meta['minimum_amount'][0] : '';
1121
+
1122
+ $coupon_maximum_amount = isset( $coupon_post_meta['maximum_amount'][0] ) && '' !== $coupon_post_meta['maximum_amount'][0] ? $coupon_post_meta['maximum_amount'][0] : '';
1123
+
1124
+ $coupon_exclude_sale_items = isset( $coupon_post_meta['exclude_sale_items'][0] ) && '' !== $coupon_post_meta['exclude_sale_items'][0] ? $coupon_post_meta['exclude_sale_items'] [0] : 'no';
1125
+
1126
+ $use_limit = isset( $coupon_post_meta['usage_limit'][0] ) && '' !== $coupon_post_meta['usage_limit'][0] ? $coupon_post_meta['usage_limit'][0] : '';
1127
+
1128
+ $use_limit_user = isset( $coupon_post_meta['usage_limit_per_user'][0] ) && '' !== $coupon_post_meta['usage_limit_per_user'][0] ? $coupon_post_meta['usage_limit_per_user'][0] : '';
1129
+
1130
+ $atc_unique = isset( $coupon_post_meta['atc_unique_coupon'][0] ) && '' !== $coupon_post_meta['atc_unique_coupon'][0] ? $coupon_post_meta['atc_unique_coupon'][0] : false;
1131
+
1132
+ if ( class_exists( 'WC_Free_Gift_Coupons' ) ) {
1133
+ $free_gift_coupon = isset( $coupon_post_meta['gift_ids'][0] ) && '' !== $coupon_post_meta['gift_ids'][0] ? $coupon_post_meta['gift_ids'][0] : '';
1134
+ $free_gift_shipping = isset( $coupon_post_meta['free_gift_shipping'][0] ) && '' !== $coupon_post_meta['free_gift_shipping'][0] ? $coupon_post_meta['free_gift_shipping'][0] : 'no';
1135
+ }
1136
+ if ( is_plugin_active( 'yith-woocommerce-brands-add-on/init.php' ) ) {
1137
+ $coupon_brand = isset( $coupon_post_meta['brand'][0] ) && '' !== $coupon_post_meta['brand'][0] ? unserialize( $coupon_post_meta['brand'][0] ) : array(); //phpcs:ignore
1138
+ }
1139
+ $amount = $discount_amt;
1140
+ $discount_type = $get_discount_type;
1141
+
1142
+ // Add coupon meta.
1143
+ $coupon_meta = array(
1144
+ 'discount_type' => $discount_type,
1145
+ 'coupon_amount' => $amount,
1146
+ 'minimum_amount' => $coupon_minimum_amount,
1147
+ 'maximum_amount' => $coupon_maximum_amount,
1148
+ 'individual_use' => $individual_use,
1149
+ 'free_shipping' => $coupon_free_shipping,
1150
+ 'product_ids' => '',
1151
+ 'exclude_product_ids' => '',
1152
+ 'usage_limit' => $use_limit,
1153
+ 'usage_limit_per_user' => $use_limit_user,
1154
+ 'date_expires' => $datetime,
1155
+ 'apply_before_tax' => 'yes',
1156
+ 'product_ids' => $coupon_product_ids,
1157
+ 'exclude_sale_items' => $coupon_exclude_sale_items,
1158
+ 'exclude_product_ids' => $coupon_exclude_product_ids,
1159
+ 'product_categories' => $coupon_product_categories,
1160
+ 'exclude_product_categories' => $coupon_exculde_product_categories,
1161
+ 'wcal_created_by' => 'wcal',
1162
+ 'atc_unique_coupon' => $atc_unique,
1163
+ );
1164
+
1165
+ if ( class_exists( 'WC_Free_Gift_Coupons' ) ) {
1166
+ $coupon_meta['gif_ids'] = $free_gift_coupon;
1167
+ $coupon_meta['free_gift_shipping'] = $free_gift_shipping;
1168
+ }
1169
+ if ( is_plugin_active( 'yith-woocommerce-brands-add-on/init.php' ) ) {
1170
+ $coupon_meta['brand'] = $coupon_brand;
1171
+ }
1172
+
1173
+ $coupon = apply_filters(
1174
+ 'wcal_cron_before_shop_coupon_create',
1175
+ array(
1176
+ 'post_title' => $coupon_code,
1177
+ 'post_content' => 'This coupon provides 5% discount on cart price.',
1178
+ 'post_status' => 'publish',
1179
+ 'post_author' => 1,
1180
+ 'post_type' => 'shop_coupon',
1181
+ 'post_expiry_date' => $datetime,
1182
+ 'meta_input' => $coupon_meta,
1183
+ )
1184
+ );
1185
+ $new_coupon_id = wp_insert_post( $coupon );
1186
+
1187
+ return $final_string;
1188
+ }
1189
+
1190
+ /**
1191
+ * It will generate 12 digit unique string for coupon code.
1192
+ *
1193
+ * @return string $temp_array 12 digit unique string
1194
+ * @since 2.3.6
1195
+ */
1196
+ public static function wp_random_string() {
1197
+ $character_set_array = array();
1198
+ $character_set_array[] = array(
1199
+ 'count' => 5,
1200
+ 'characters' => 'abcdefghijklmnopqrstuvwxyz',
1201
+ );
1202
+ $character_set_array[] = array(
1203
+ 'count' => 5,
1204
+ 'characters' => '0123456789',
1205
+ );
1206
+ $temp_array = array();
1207
+ foreach ( $character_set_array as $character_set ) {
1208
+ for ( $i = 0; $i < $character_set['count']; $i++ ) {
1209
+ $temp_array[] = $character_set['characters'][ wp_rand( 0, strlen( $character_set['characters'] ) - 1 ) ];
1210
+ }
1211
+ }
1212
+ shuffle( $temp_array );
1213
+ return implode( '', $temp_array );
1214
+ }
1215
+
1216
+ /**
1217
+ * It will captures the coupon code used by the customers.
1218
+ * It will store the coupon code for the specific abandoned cart.
1219
+ *
1220
+ * @hook woocommerce_applied_coupon
1221
+ * @param string $valid Coupon code.
1222
+ * @return string $valid Coupon code.
1223
+ * @globals mixed $wpdb
1224
+ * @since 5.11.0
1225
+ */
1226
+ public static function wcal_capture_applied_coupon( $valid ) {
1227
+
1228
+ global $wpdb;
1229
+
1230
+ $coupon_code = self::wcal_get_cart_session( 'wcal_c' );
1231
+
1232
+ $user_id = self::wcal_get_cart_session( 'wcal_user_id' );
1233
+
1234
+ $user_id = '' !== $user_id ? $user_id : get_current_user_id();
1235
+
1236
+ if ( '' === $coupon_code && isset( $_POST['coupon_code'] ) ) { //phpcs:ignore
1237
+ $coupon_code = $_POST['coupon_code']; //phpcs:ignore
1238
+ } elseif ( isset( $valid ) ) {
1239
+ $coupon_code = $valid;
1240
+ }
1241
+
1242
+ if ( '' !== $valid ) {
1243
+ if ( is_user_logged_in() ) {
1244
+
1245
+ $abandoned_cart_id_query = 'SELECT id FROM `' . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0'";
1246
+ $abandoned_cart_id_results = $wpdb->get_results( $wpdb->prepare( $abandoned_cart_id_query, $user_id ) ); //phpcs:ignore
1247
+ } elseif ( ! is_user_logged_in() ) {
1248
+ $abandoned_cart_id_query = 'SELECT id FROM `' . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0' ORDER BY id DESC LIMIT 1";
1249
+ $abandoned_cart_id_results = $wpdb->get_results( $wpdb->prepare( $abandoned_cart_id_query, $user_id ) ); //phpcs:ignore
1250
+ }
1251
+
1252
+ $abandoned_cart_id = '0';
1253
+ if ( isset( $abandoned_cart_id_results ) && ! empty( $abandoned_cart_id_results ) ) {
1254
+ $abandoned_cart_id = $abandoned_cart_id_results[0]->id;
1255
+ }
1256
+ $existing_coupon = ( get_user_meta( $user_id, '_woocommerce_ac_coupon', true ) );
1257
+ $applied = wcal_Common::wcal_update_coupon_post_meta( $abandoned_cart_id, $coupon_code );
1258
+ if ( $applied ) {
1259
+ return $valid;
1260
+ }
1261
+ if ( is_array( $existing_coupon ) && count( $existing_coupon ) > 0 ) {
1262
+ foreach ( $existing_coupon as $key => $value ) {
1263
+ if ( isset( $existing_coupon[ $key ]['coupon_code'] ) && $existing_coupon[ $key ]['coupon_code'] !== $coupon_code ) {
1264
+ $existing_coupon[] = array(
1265
+ 'coupon_code' => $coupon_code,
1266
+ 'coupon_message' => __(
1267
+ 'Discount code applied successfully.',
1268
+ 'woocommerce-ac'
1269
+ ),
1270
+ );
1271
+ update_user_meta(
1272
+ $user_id,
1273
+ '_woocommerce_ac_coupon',
1274
+ $existing_coupon
1275
+ );
1276
+ return $valid;
1277
+ }
1278
+ }
1279
+ } else {
1280
+ $coupon_details[] = array(
1281
+ 'coupon_code' => $coupon_code,
1282
+ 'coupon_message' => __(
1283
+ 'Discount code applied successfully.',
1284
+ 'woocommerce-ac'
1285
+ ),
1286
+ );
1287
+ update_user_meta( $user_id, '_woocommerce_ac_coupon', $coupon_details );
1288
+ return $valid;
1289
+ }
1290
+ }
1291
+
1292
+ return $valid;
1293
+ }
1294
+
1295
+ /**
1296
+ * Update the Coupon data in post meta table.
1297
+ *
1298
+ * @param int $cart_id - Abandoned Cart ID.
1299
+ * @param string $coupon_code - Coupon code to be updated.
1300
+ * @param string $msg - Msg to be added for the coupon.
1301
+ * @since 5.11
1302
+ */
1303
+ public static function wcal_update_coupon_post_meta( $cart_id, $coupon_code, $msg = '' ) {
1304
+
1305
+ // Set default.
1306
+ $msg = '' !== $msg ? $msg : __( 'Discount code applied successfully.', 'woocommerce-ac' );
1307
+ // Fetch the record from the DB.
1308
+ $get_coupons = get_post_meta( $cart_id, '_woocommerce_ac_coupon', true );
1309
+
1310
+ // Create a return array.
1311
+ $return_coupons = array();
1312
+
1313
+ // If any coupon have been applied, populate them in the return array.
1314
+ if ( is_array( $get_coupons ) && count( $get_coupons ) > 0 ) {
1315
+ $exists = false;
1316
+ foreach ( $get_coupons as $coupon_data ) {
1317
+ if ( isset( $coupon_data['coupon_code'] ) && $coupon_code === $coupon_data['coupon_code'] ) {
1318
+ $exists = true;
1319
+ }
1320
+ }
1321
+
1322
+ if ( ! $exists ) {
1323
+ $get_coupons[] = array(
1324
+ 'coupon_code' => $coupon_code,
1325
+ 'coupon_message' => $msg,
1326
+ );
1327
+ update_post_meta( $cart_id, '_woocommerce_ac_coupon', $get_coupons );
1328
+ return true;
1329
+ }
1330
+ } else {
1331
+ $get_coupons = array();
1332
+ $get_coupons[] = array(
1333
+ 'coupon_code' => $coupon_code,
1334
+ 'coupon_message' => $msg,
1335
+ );
1336
+ update_post_meta( $cart_id, '_woocommerce_ac_coupon', $get_coupons );
1337
+ return true;
1338
+ }
1339
+ return false;
1340
+ }
1341
+
1342
+ /**
1343
+ * It will captures the coupon code errors specific to the abandoned carts.
1344
+ *
1345
+ * @hook woocommerce_coupon_error.
1346
+ * @param string $valid Error.
1347
+ * @param string $new Error code.
1348
+ * @globals mixed $wpdb .
1349
+ * @return string $valid Error.
1350
+ * @since 2.4.3
1351
+ */
1352
+ public static function wcal_capture_coupon_error( $valid, $new ) {
1353
+
1354
+ global $wpdb;
1355
+ $coupon_code = self::wcal_get_cart_session( 'wcal_c' );
1356
+
1357
+ $user_id = self::wcal_get_cart_session( 'wcal_user_id' );
1358
+
1359
+ $user_id = '' !== $user_id ? $user_id : get_current_user_id();
1360
+
1361
+ $abandoned_cart_id_query = 'SELECT id FROM `' . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0' ORDER BY id DESC LIMIT 1";
1362
+ $abandoned_cart_id_results = $wpdb->get_results( $wpdb->prepare( $abandoned_cart_id_query, $user_id ) ); //phpcs:ignore
1363
+ $abandoned_cart_id = '0';
1364
+
1365
+ if ( isset( $abandoned_cart_id_results ) && count( $abandoned_cart_id_results ) > 0 ) {
1366
+ $abandoned_cart_id = $abandoned_cart_id_results[0]->id;
1367
+ }
1368
+
1369
+ if ( $coupon_code == '' && isset( $_POST['coupon_code'] ) ) { //phpcs:ignore
1370
+ $coupon_code = $_POST['coupon_code']; //phpcs:ignore
1371
+ }
1372
+
1373
+ if ( '' !== $coupon_code ) {
1374
+ $existing_coupon = get_user_meta( $user_id, '_woocommerce_ac_coupon', false );
1375
+ $existing_coupon[] = array(
1376
+ 'coupon_code' => $coupon_code,
1377
+ 'coupon_message' => $valid,
1378
+ );
1379
+ $post_meta_coupon_array = array(
1380
+ 'coupon_code' => $coupon_code,
1381
+ 'coupon_message' => $valid,
1382
+ );
1383
+ if ( $user_id > 0 ) {
1384
+ $updated = wcal_Common::wcal_update_coupon_post_meta( $abandoned_cart_id, $coupon_code, $valid );
1385
+ }
1386
+ update_user_meta( $user_id, '_woocommerce_ac_coupon', $existing_coupon );
1387
+ }
1388
+ return $valid;
1389
+ }
1390
+
1391
+ /**
1392
+ * It will directly apply the coupon code if the coupon code present in the abandoned cart reminder email link.
1393
+ * It will apply direct coupon on cart and checkout page.
1394
+ *
1395
+ * @hook woocommerce_before_cart_table
1396
+ * @hook woocommerce_before_checkout_form
1397
+ *
1398
+ * @param string $coupon_code Name of coupon.
1399
+ * @since 5.11
1400
+ */
1401
+ public static function wcal_apply_direct_coupon_code( $coupon_code ) {
1402
+ global $woocommerce_abandon_cart;
1403
+ remove_action( 'woocommerce_cart_updated', array( $woocommerce_abandon_cart, 'wcal_store_cart_timestamp' ) );
1404
+
1405
+ $wcal_language = self::wcal_get_cart_session( 'wcal_selected_language' );
1406
+ if ( '' !== $wcal_language && function_exists( 'icl_register_string' ) ) {
1407
+ global $sitepress;
1408
+ if ( null !== $sitepress ) {
1409
+ $sitepress->switch_lang( $wcal_language );
1410
+ }
1411
+ }
1412
+
1413
+ $coupon_code = self::wcal_get_cart_session( 'wcal_c' );
1414
+
1415
+ if ( isset( $coupon_code ) && '' !== $coupon_code ) {
1416
+
1417
+ // If coupon has been already been added remove it.
1418
+ if ( WC()->cart->has_discount( sanitize_text_field( $coupon_code ) ) ) {
1419
+ if ( ! WC()->cart->remove_coupons( sanitize_text_field( $coupon_code ) ) ) {
1420
+ wc_print_notices();
1421
+ }
1422
+ }
1423
+ // Add coupon.
1424
+ if ( ! WC()->cart->add_discount( sanitize_text_field( $coupon_code ) ) ) {
1425
+ wc_print_notices();
1426
+ } else {
1427
+ wc_print_notices();
1428
+ }
1429
+ // Manually recalculate totals. If you do not do this, a refresh is required before user will see updated totals when discount is removed.
1430
+ WC()->cart->calculate_totals();
1431
+ // need to clear the coupon code from session.
1432
+ self::wcal_unset_cart_session( 'wcal_c' );
1433
+ }
1434
+ }
1435
+
1436
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: ashokrane, pinal.shah, bhavik.kiri, chetnapatel, tychesoftwares, d
4
  Tags: cart abandonment, abandon cart, cart recovery, recover woocommerce cart, increase woocommerce conversion rate, increase sales with woocommerce
5
  Author URI: https://www.tychesoftwares.com/
6
  Requires at least: 1.3
7
- Tested up to: 5.8
8
  Stable tag: trunk
9
  Requires PHP: 5.6
10
  License: GPLv2 or late
@@ -222,6 +222,12 @@ The admin can use the merge code `{{cart.unsubscribe}}' in the email templates.
222
  6. Product Report Tab.
223
 
224
  == Changelog ==
 
 
 
 
 
 
225
  = 5.10.0 ( 25.08.2021) =
226
  * Enhancement - Added the ability to setup reminder email frequency in minutes.
227
  * Tweak - Added a filter to allow reminder emails to be sent for carts with the total as 0.
4
  Tags: cart abandonment, abandon cart, cart recovery, recover woocommerce cart, increase woocommerce conversion rate, increase sales with woocommerce
5
  Author URI: https://www.tychesoftwares.com/
6
  Requires at least: 1.3
7
+ Tested up to: 5.8.1
8
  Stable tag: trunk
9
  Requires PHP: 5.6
10
  License: GPLv2 or late
222
  6. Product Report Tab.
223
 
224
  == Changelog ==
225
+ = 5.11.0 ( 02.11.2021 ) =
226
+ * Enhancement - Added a new merge tag to include Coupon codes in email reminders.
227
+ * Enhancement - Users can now set up the plugin to generate a unique coupon code in the reminder email or use an existing coupon created in Marketing > Coupons.
228
+ * Enhancement - Coupons sent in reminder emails will be auto-applied when the cart link in the reminder email is accessed.
229
+ * Enhancement - The site admin can now set up the plugin to automatically delete the expired and/or used coupons created by the plugin using WP Cron or delete them manually from the plugin settings page.
230
+
231
  = 5.10.0 ( 25.08.2021) =
232
  * Enhancement - Added the ability to setup reminder email frequency in minutes.
233
  * Tweak - Added a filter to allow reminder emails to be sent for carts with the total as 0.
views/wcal-email-coupon.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin View: Abandoned Cart Coupon
4
+ *
5
+ * @package abandoned-cart-lite
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Abandoned Cart Lite for WooCommerce
14
+ *
15
+ * It will handle the coupon inclusion in email templates and custom email template.
16
+ *
17
+ * @author Tyche Softwares
18
+ * @since 5.11
19
+ */
20
+ ?>
21
+ <tr>
22
+ <th>
23
+ <label for="unique_coupon">
24
+ <?php esc_html_e( 'Generate unique coupon codes:', 'woocommerce-abandoned-cart' ); ?>
25
+ </label>
26
+ </th>
27
+ <td>
28
+ <?php
29
+ $is_unique_coupon = '';
30
+ if ( 'edittemplate' === $mode ) {
31
+ $unique_coupon = isset( $results[0]->generate_unique_coupon_code ) ? $results[0]->generate_unique_coupon_code : '';
32
+ $is_unique_coupon = '';
33
+ if ( '1' === $unique_coupon ) {
34
+ $is_unique_coupon = 'checked';
35
+ }
36
+ }
37
+ if ( 'copytemplate' === $mode ) {
38
+ $unique_coupon = isset( $results_copy[0]->generate_unique_coupon_code ) ? $results_copy[0]->generate_unique_coupon_code : '';
39
+ $is_unique_coupon = '';
40
+ if ( '1' === $unique_coupon ) {
41
+ $is_unique_coupon = 'checked';
42
+ }
43
+ }
44
+ print '<input type="checkbox" name="unique_coupon" id="unique_coupon" ' . esc_attr( $is_unique_coupon ) . '> </input>';
45
+ ?>
46
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_html_e( 'Replace this coupon with unique coupon codes for each customer', 'woocommerce' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" /></p>
47
+ </td>
48
+ </tr>
49
+
50
+ <!-- Below is the Coupon Code Options chnages -->
51
+
52
+ <?php
53
+ $show_row = 'display:none;';
54
+ if ( '' !== $is_unique_coupon ) {
55
+ $show_row = '';
56
+ }
57
+ ?>
58
+ <tr class="wcal_discount_options_rows" style="<?php echo esc_attr( $show_row ); ?>">
59
+ <th>
60
+ <label class="wcal_discount_options" for="wcal_discount_type">
61
+ <?php esc_html_e( 'Discount Type:', 'woocommerce-abandoned-cart' ); ?>
62
+ </label>
63
+ </th>
64
+ <td>
65
+ <?php
66
+
67
+ $discount_type = isset( $results[0]->discount_type ) ? $results[0]->discount_type : '';
68
+
69
+ if ( 'copytemplate' === $mode ) {
70
+ $discount_type = isset( $results_copy[0]->discount_type ) ? $results_copy[0]->discount_type : '';
71
+ }
72
+
73
+ $percent = 'percent' === $discount_type ? true : '';
74
+ $fixed = 'fixed' === $discount_type ? true : '';
75
+ ?>
76
+ <select id="wcal_discount_type" name="wcal_discount_type">
77
+ <option value="percent" <?php if( $percent) { esc_attr_e( 'selected' ); } //phpcs:ignore ?> ><?php esc_html_e( 'Percentage discount', 'woocommerce-abandoned-cart' ); ?></option>
78
+ <option value="fixed" <?php if( $fixed) { esc_attr_e( 'selected' ); } //phpcs:ignore ?> ><?php esc_html_e( 'Fixed cart discount', 'woocommerce-abandoned-cart' ); ?></option>
79
+ </select>
80
+ </td>
81
+ </tr>
82
+ <tr class="wcal_discount_options_rows" style="<?php echo esc_attr( $show_row ); ?>">
83
+ <th>
84
+ <label class="wcal_discount_options" for="wcal_coupon_amount">
85
+ <?php esc_html_e( 'Coupon amount:', 'woocommerce-abandoned-cart' ); ?>
86
+ </label>
87
+ </th>
88
+ <td>
89
+ <?php
90
+ $discount = 0;
91
+ if ( 'edittemplate' === $mode ) {
92
+ $discount = isset( $results[0]->discount ) ? $results[0]->discount : '';
93
+ }
94
+
95
+ if ( 'copytemplate' === $mode ) {
96
+ $discount = isset( $results_copy[0]->discount ) ? $results_copy[0]->discount : '';
97
+ }
98
+
99
+ print '<input type="text" style="width:8%;" name="wcal_coupon_amount" id="wcal_coupon_amount" class="short" value="' . esc_attr( $discount ) . '">';
100
+ ?>
101
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_attr_e( 'Value of the coupon.', 'woocommerce' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" />
102
+ </td>
103
+ </tr>
104
+
105
+ <tr class="wcal_discount_options_rows" style="<?php echo esc_attr( $show_row ); ?>">
106
+ <th>
107
+ <label class="wcal_discount_options" for="wcal_allow_free_shipping">
108
+ <?php esc_html_e( 'Allow free shipping:', 'woocommerce-abandoned-cart' ); ?>
109
+ </label>
110
+ </th>
111
+ <td>
112
+ <?php
113
+ $discount_shipping_check = '';
114
+ $discount_shipping = '';
115
+ if ( 'edittemplate' === $mode ) {
116
+ $discount_shipping = isset( $results[0]->discount_shipping ) ? $results[0]->discount_shipping : '';
117
+ }
118
+ if ( 'copytemplate' === $mode ) {
119
+ $discount_shipping = isset( $results_copy[0]->discount_shipping ) ? $results_copy[0]->discount_shipping : '';
120
+ }
121
+ if ( 'yes' === $discount_shipping ) {
122
+ $discount_shipping_check = 'checked';
123
+ }
124
+ print '<input type="checkbox" name="wcal_allow_free_shipping" id="wcal_allow_free_shipping" ' . esc_attr( $discount_shipping_check ) . '> </input>';
125
+ ?>
126
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_html_e( 'Check this box if the coupon grants free shipping. A free shipping method must be enabled in your shipping zone and be set to require "a valid free shipping coupon" (see the "Free Shipping Requires" setting).', 'woocommerce-abandoned-cart' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" />
127
+
128
+ </td>
129
+ </tr>
130
+
131
+ <tr class="wcal_discount_options_rows" style="<?php echo esc_attr( $show_row ); ?>">
132
+ <th>
133
+ <label class="wcal_discount_options" for="wcal_coupon_expiry">
134
+ <?php esc_html_e( 'Coupon validity:', 'woocommerce-abandoned-cart' ); ?>
135
+ </label>
136
+ </th>
137
+ <td>
138
+ <?php
139
+ $wcal_coupon_expiry = '7-days';
140
+ $expiry_days_or_hours = array(
141
+ 'hours' => 'Hour(s)',
142
+ 'days' => 'Day(s)',
143
+ );
144
+ if ( 'edittemplate' === $mode ) {
145
+ $wcal_coupon_expiry = isset( $results[0]->discount_expiry ) ? $results[0]->discount_expiry : '';
146
+ }
147
+ if ( 'copytemplate' === $mode ) {
148
+ $wcal_coupon_expiry = isset( $results_copy[0]->discount_expiry ) ? $results_copy[0]->discount_expiry : '';
149
+ }
150
+
151
+ $wcal_coupon_expiry_explode = explode( '-', $wcal_coupon_expiry );
152
+ $expiry_number = isset( $wcal_coupon_expiry_explode[0] ) ? $wcal_coupon_expiry_explode[0] : 0;
153
+ $expiry_freq = isset( $wcal_coupon_expiry_explode[1] ) ? $wcal_coupon_expiry_explode[1] : 'hours';
154
+
155
+ print '<input type="text" style="width:8%;" name="wcal_coupon_expiry" id="wcal_coupon_expiry" value="' . esc_attr( $expiry_number ) . '"> </input>';
156
+ ?>
157
+ <select name="expiry_day_or_hour" id="expiry_day_or_hour">
158
+ <?php
159
+ foreach ( $expiry_days_or_hours as $k => $v ) {
160
+ printf(
161
+ "<option %s value='%s'>%s</option>\n",
162
+ selected( $k, $expiry_freq, false ),
163
+ esc_attr( $k ),
164
+ esc_attr( $v )
165
+ );
166
+ }
167
+ ?>
168
+ </select>
169
+
170
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_html_e( 'The coupon code which will be sent in the reminder emails will be expired based the validity set here. E.g if the coupon code sent in the reminder email should be expired after 7 days then set 7 Day(s) for this option.', 'woocommerce-abandoned-cart' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" />
171
+ </td>
172
+ </tr>
173
+
174
+ <tr class='wcal_discount_options_rows' style='<?php echo esc_attr( $show_row ); ?>'>
175
+ <th>
176
+ <label class='wcal_discount_options' for='individual_use'>
177
+ <?php esc_html_e( 'Individual use only:', 'woocommerce-abandoned-cart' ); ?>
178
+ </label>
179
+ </th>
180
+ <td>
181
+ <?php
182
+ $is_individual_use = 'checked';
183
+ if ( 'edittemplate' === $mode ) {
184
+ $individual_use = isset( $results[0]->individual_use ) ? $results[0]->individual_use : '';
185
+ if ( '1' !== $individual_use ) {
186
+ $is_individual_use = '';
187
+ }
188
+ }
189
+ if ( 'copytemplate' === $mode ) {
190
+ $individual_use = isset( $results_copy[0]->individual_use ) ? $results_copy[0]->individual_use : '';
191
+ if ( '1' !== $individual_use ) {
192
+ $is_individual_use = '';
193
+ }
194
+ }
195
+ print '<input type="checkbox" name="individual_use" id="individual_use" ' . esc_attr( $is_individual_use ) . '> </input>';
196
+ ?>
197
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_attr_e( 'Check this box if the coupon cannot be used in conjunction with other coupons.', 'woocommerce' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" /></p>
198
+ </td>
199
+ </tr>
200
+
201
+ <tr><th></th><td><b><?php esc_html_e( 'OR', 'woocommerce-abandoned-cart' ); ?></b></td></tr>
202
+ <tr>
203
+ <th>
204
+ <label for="woocommerce_ac_coupon_auto_complete">
205
+ <?php esc_html_e( 'Enter a coupon code to add into email:', 'woocommerce-abandoned-cart' ); ?>
206
+ </label>
207
+ </th>
208
+ <td>
209
+ <!-- code started for woocommerce auto-complete coupons field emoved from class : woocommerce_options_panelfor WC 2.5 -->
210
+ <div id="coupon_options" class="panel">
211
+ <div class="options_group">
212
+ <p class="form-field" style="padding-left:0px !important;">
213
+ <?php
214
+
215
+ $json_ids = array();
216
+ $coupon_ids = array();
217
+ $coupon_code_id = '';
218
+ if ( 'edittemplate' === $mode ) {
219
+ $coupon_code_id = $results[0]->coupon_code;
220
+ }
221
+ if ( 'copytemplate' === $mode ) {
222
+ $coupon_code_id = $results_copy[0]->coupon_code;
223
+ }
224
+ if ( $coupon_code_id > 0 ) {
225
+ if ( 'edittemplate' === $mode ) {
226
+ $coupon_ids = explode( ',', $results[0]->coupon_code );
227
+ }
228
+ if ( 'copytemplate' === $mode ) {
229
+ $coupon_ids = explode( ',', $results_copy[0]->coupon_code );
230
+ }
231
+ foreach ( $coupon_ids as $product_id ) {
232
+ if ( $product_id > 0 ) {
233
+ $product = get_the_title( $product_id );
234
+ $json_ids[ $product_id ] = $product;
235
+ }
236
+ }
237
+ }
238
+ global $woocommerce;
239
+
240
+ if ( version_compare( $woocommerce->version, '3.0.0', '>=' ) ) {
241
+ ?>
242
+ <select id="coupon_ids" name="coupon_ids[]" class="wc-product-search" multiple="multiple" style="width: 50%;" data-placeholder="<?php esc_attr_e( 'Search for a Coupon&hellip;', 'woocommerce' ); ?>" data-action="wcal_json_find_coupons">
243
+ <?php
244
+ foreach ( $coupon_ids as $product_id ) {
245
+ if ( $product_id > 0 ) {
246
+ $product = get_the_title( $product_id );
247
+ echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product ) . '</option>';
248
+ }
249
+ }
250
+ ?>
251
+ </select>
252
+ <?php
253
+ } else {
254
+ ?>
255
+ <input type="hidden" id="coupon_ids" name="coupon_ids[]" class="wc-product-search" style="width: 30%;" data-placeholder="<?php esc_attr_e( 'Search for a Coupon&hellip;', 'woocommerce' ); ?>" data-multiple="true" data-action="wcal_json_find_coupons"
256
+ data-selected=" <?php echo esc_attr( wp_json_encode( $json_ids ) ); ?> " value="<?php echo esc_attr( implode( ',', array_keys( $json_ids ) ) ); ?>"
257
+ />
258
+ <?php
259
+ }
260
+ ?>
261
+ <img class="help_tip" width="16" height="16" data-tip='<?php esc_html_e( 'Search & select one coupon code that customers should use to get a discount. Generated coupon code which will be sent in email reminder will have the settings of coupon selected in this option.', 'woocommerce-abandoned-cart' ); ?>' src="<?php echo esc_attr( plugins_url() ); ?>/woocommerce/assets/images/help.png" />
262
+ </p>
263
+ </div>
264
+ </div>
265
+ <!-- code ended for woocommerce auto-complete coupons field -->
266
+ </td>
267
+ </tr>
268
+
269
+ <!-- The Coupon Code Options chnages ends here -->
270
+ <script type="text/javascript">
271
+ jQuery( document ).ready(function (){
272
+ /* Showing hiding discount options */
273
+ jQuery('#unique_coupon').click(function(){
274
+ if ( jQuery( "#unique_coupon" ).prop( "checked" ) == false ){
275
+ jQuery('.wcal_discount_options_rows').hide();
276
+ } else {
277
+ jQuery('.wcal_discount_options_rows').removeAttr( "style" );
278
+ }
279
+ });
280
+ jQuery( document.body ).trigger( 'wc-enhanced-select-init' );
281
+ })
282
+ </script>
woocommerce-ac.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Abandoned Cart Lite for WooCommerce
4
  * Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  * Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
- * Version: 5.10.0
7
  * Author: Tyche Softwares
8
  * Author URI: http://www.tychesoftwares.com/
9
  * Text Domain: woocommerce-abandoned-cart
10
  * Domain Path: /i18n/languages/
11
  * Requires PHP: 5.6
12
  * WC requires at least: 3.0.0
13
- * WC tested up to: 5.6.0
14
  *
15
  * @package Abandoned-Cart-Lite-for-WooCommerce
16
  */
@@ -118,7 +118,7 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
118
  }
119
 
120
  if ( ! defined( 'WCAL_PLUGIN_VERSION' ) ) {
121
- define( 'WCAL_PLUGIN_VERSION', '5.10.0' );
122
  }
123
 
124
  if ( ! defined( 'WCAL_PLUGIN_PATH' ) ) {
@@ -235,6 +235,8 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
235
  add_filter( 'ts_tracker_data', array( 'wcal_common', 'ts_add_plugin_tracking_data' ), 10, 1 );
236
  add_filter( 'ts_tracker_opt_out_data', array( 'wcal_common', 'ts_get_data_for_opt_out' ), 10, 1 );
237
  add_filter( 'ts_deativate_plugin_questions', array( &$this, 'wcal_deactivate_add_questions' ), 10, 1 );
 
 
238
  }
239
 
240
  // Plugin Settings link in WP->Plugins page.
@@ -249,6 +251,17 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
249
  add_action( 'admin_notices', array( 'Wcal_Admin_Notice', 'wcal_show_db_update_notice' ) );
250
 
251
  include_once 'includes/frontend/class-wcal-frontend.php';
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
 
254
  /**
@@ -589,6 +602,13 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
589
  `is_wc_template` enum('0','1') NOT NULL,
590
  `default_template` int(11) NOT NULL,
591
  `wc_email_header` varchar(50) NOT NULL,
 
 
 
 
 
 
 
592
  PRIMARY KEY (`id`)
593
  ) $wcap_collate AUTO_INCREMENT=1"
594
  );
@@ -813,7 +833,22 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
813
  'ac_lite_general_settings_section',
814
  array( __( '<br>Message to be displayed when the user chooses to opt out of cart tracking.</i>', 'woocommerce-abandoned-cart' ) )
815
  );
816
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
817
  /**
818
  * New section for the Adding the abandoned cart setting.
819
  *
@@ -855,11 +890,11 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
855
 
856
  add_settings_field(
857
  'wcal_add_utm_to_links',
858
- __( 'UTM parameters to be added to all the links in reminder emails', 'woocommerce-ac' ),
859
  array( &$this, 'wcal_add_utm_to_links_callback' ),
860
  'woocommerce_ac_email_page',
861
  'ac_email_settings_section',
862
- array( __( 'UTM parameters that should be added to all the links in reminder emails.', 'woocommerce-ac' ) )
863
  );
864
 
865
  // Finally, we register the fields with WordPress.
@@ -928,6 +963,11 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
928
  'wcal_add_utm_to_links'
929
  );
930
 
 
 
 
 
 
931
  do_action( 'wcal_add_new_settings' );
932
  }
933
 
@@ -1699,6 +1739,17 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
1699
  $sent_email_id_pos = strpos( $link_decode, '&' );
1700
  $email_sent_id = substr( $link_decode, 0, $sent_email_id_pos );
1701
 
 
 
 
 
 
 
 
 
 
 
 
1702
  wcal_common::wcal_set_cart_session( 'email_sent_id', $email_sent_id );
1703
  set_transient( 'wcal_email_sent_id', $email_sent_id, 5 );
1704
 
@@ -2250,6 +2301,39 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
2250
  'ajax_url' => admin_url( 'admin-ajax.php' ),
2251
  )
2252
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2253
  }
2254
  }
2255
 
@@ -2638,12 +2722,15 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
2638
  $day_or_hour = isset( $_POST['day_or_hour'] ) ? trim( sanitize_text_field( wp_unslash( $_POST['day_or_hour'] ) ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
2639
  $is_wc_template = empty( $_POST['is_wc_template'] ) ? '0' : '1'; // phpcs:ignore WordPress.Security.NonceVerification
2640
 
2641
- if ( isset( $_POST['ac_settings_frm'] ) && 'save' === sanitize_text_field( wp_unslash( $_POST['ac_settings_frm'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification
2642
- $default_value = 0;
 
 
 
2643
 
2644
  $insert_template_successfuly = $wpdb->query( //phpcs:ignore
2645
  $wpdb->prepare(
2646
- 'INSERT INTO `' . $wpdb->prefix . 'ac_email_templates_lite` (subject, body, frequency, day_or_hour, template_name, is_wc_template, default_template, wc_email_header ) VALUES ( %s, %s, %d, %s, %s, %s, %d, %s )',
2647
  $woocommerce_ac_email_subject,
2648
  $woocommerce_ac_email_body,
2649
  $email_frequency,
@@ -2651,7 +2738,14 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
2651
  $woocommerce_ac_template_name,
2652
  $is_wc_template,
2653
  $default_value,
2654
- $woocommerce_ac_email_header
 
 
 
 
 
 
 
2655
  )
2656
  );
2657
  }
@@ -2674,10 +2768,13 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
2674
  $default_value = '1';
2675
  }
2676
  }
 
 
 
2677
 
2678
  $update_template_successfuly = $wpdb->query( //phpcs:ignore
2679
  $wpdb->prepare(
2680
- 'UPDATE `' . $wpdb->prefix . 'ac_email_templates_lite` SET subject = %s, body = %s, frequency = %d, day_or_hour = %s, template_name = %s, is_wc_template = %s, default_template = %d, wc_email_header = %s WHERE id = %d',
2681
  $woocommerce_ac_email_subject,
2682
  $woocommerce_ac_email_body,
2683
  $email_frequency,
@@ -2686,6 +2783,13 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
2686
  $is_wc_template,
2687
  $default_value,
2688
  $woocommerce_ac_email_header,
 
 
 
 
 
 
 
2689
  $id
2690
  )
2691
  );
@@ -3499,7 +3603,7 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
3499
  </span>
3500
  </td>
3501
  </tr>
3502
-
3503
  <tr>
3504
  <th>
3505
  <label for="woocommerce_ac_email_preview"><b><?php esc_html_e( 'Send a test email to:', 'woocommerce-abandoned-cart' ); ?></b></label>
@@ -3880,6 +3984,326 @@ if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
3880
  die();
3881
  }
3882
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3883
  }
3884
  }
3885
  $woocommerce_abandon_cart = new woocommerce_abandon_cart_lite();
3
  * Plugin Name: Abandoned Cart Lite for WooCommerce
4
  * Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  * Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
+ * Version: 5.11.0
7
  * Author: Tyche Softwares
8
  * Author URI: http://www.tychesoftwares.com/
9
  * Text Domain: woocommerce-abandoned-cart
10
  * Domain Path: /i18n/languages/
11
  * Requires PHP: 5.6
12
  * WC requires at least: 3.0.0
13
+ * WC tested up to: 5.8.0
14
  *
15
  * @package Abandoned-Cart-Lite-for-WooCommerce
16
  */
118
  }
119
 
120
  if ( ! defined( 'WCAL_PLUGIN_VERSION' ) ) {
121
+ define( 'WCAL_PLUGIN_VERSION', '5.11.0' );
122
  }
123
 
124
  if ( ! defined( 'WCAL_PLUGIN_PATH' ) ) {
235
  add_filter( 'ts_tracker_data', array( 'wcal_common', 'ts_add_plugin_tracking_data' ), 10, 1 );
236
  add_filter( 'ts_tracker_opt_out_data', array( 'wcal_common', 'ts_get_data_for_opt_out' ), 10, 1 );
237
  add_filter( 'ts_deativate_plugin_questions', array( &$this, 'wcal_deactivate_add_questions' ), 10, 1 );
238
+
239
+ add_action( 'wp_ajax_wcal_json_find_coupons', array( &$this, 'wcal_json_find_coupons' ) );
240
  }
241
 
242
  // Plugin Settings link in WP->Plugins page.
251
  add_action( 'admin_notices', array( 'Wcal_Admin_Notice', 'wcal_show_db_update_notice' ) );
252
 
253
  include_once 'includes/frontend/class-wcal-frontend.php';
254
+
255
+ add_filter( 'cron_schedules', array( __CLASS__, 'wcal_add_cron_schedule' ) ); //phpcs:ignore
256
+ add_action( 'woocommerce_ac_delete_coupon_action', array( __CLASS__, 'wcal_delete_expired_used_coupon_code' ) );
257
+ add_action( 'wp_ajax_wcal_delete_expired_used_coupon_code', array( __CLASS__, 'wcal_delete_expired_used_coupon_code' ) );
258
+
259
+ add_action( 'woocommerce_coupon_error', array( 'wcal_common', 'wcal_capture_coupon_error' ), 15, 2 );
260
+ add_action( 'woocommerce_applied_coupon', array( 'wcal_common', 'wcal_capture_applied_coupon' ), 15, 2 );
261
+
262
+ add_action( 'woocommerce_before_cart_table', array( 'wcal_common', 'wcal_apply_direct_coupon_code' ) );
263
+ // Add coupon when user views checkout page (would not be added otherwise, unless user views cart first).
264
+ add_action( 'woocommerce_before_checkout_form', array( 'wcal_common', 'wcal_apply_direct_coupon_code' ) );
265
  }
266
 
267
  /**
602
  `is_wc_template` enum('0','1') NOT NULL,
603
  `default_template` int(11) NOT NULL,
604
  `wc_email_header` varchar(50) NOT NULL,
605
+ `coupon_code` varchar(50) NOT NULL,
606
+ `discount` varchar(50) NOT NULL,
607
+ `discount_type` varchar(50) NOT NULL,
608
+ `discount_shipping` varchar(50) NOT NULL,
609
+ `discount_expiry` varchar(50) NOT NULL,
610
+ `individual_use` enum('0','1') NOT NULL,
611
+ `generate_unique_coupon_code` enum('0','1') NOT NULL,
612
  PRIMARY KEY (`id`)
613
  ) $wcap_collate AUTO_INCREMENT=1"
614
  );
833
  'ac_lite_general_settings_section',
834
  array( __( '<br>Message to be displayed when the user chooses to opt out of cart tracking.</i>', 'woocommerce-abandoned-cart' ) )
835
  );
836
+ add_settings_field(
837
+ 'wcal_delete_coupon_data',
838
+ __( 'Delete Coupons Automatically', 'woocommerce-abandoned-cart' ),
839
+ array( $this, 'wcal_deleting_coupon_data' ),
840
+ 'woocommerce_ac_page',
841
+ 'ac_lite_general_settings_section',
842
+ array( __( 'Enable this setting if you want to completely remove the expired and used coupon code automatically every 15 days.', 'woocommerce-abandoned-cart' ) )
843
+ );
844
+ add_settings_field(
845
+ 'wcal_delete_coupon_data_manually',
846
+ __( 'Delete Coupons Manually', 'woocommerce-abandoned-cart' ),
847
+ array( $this, 'wcal_deleting_coupon_data_manually' ),
848
+ 'woocommerce_ac_page',
849
+ 'ac_lite_general_settings_section',
850
+ array( __( 'If you want to completely remove the expired and used coupon code now then click on "Delete" button.', 'woocommerce-abandoned-cart' ) )
851
+ );
852
  /**
853
  * New section for the Adding the abandoned cart setting.
854
  *
890
 
891
  add_settings_field(
892
  'wcal_add_utm_to_links',
893
+ __( 'UTM parameters to be added to all the links in reminder emails', 'woocommerce-abandoned-cart' ),
894
  array( &$this, 'wcal_add_utm_to_links_callback' ),
895
  'woocommerce_ac_email_page',
896
  'ac_email_settings_section',
897
+ array( __( 'UTM parameters that should be added to all the links in reminder emails.', 'woocommerce-abandoned-cart' ) )
898
  );
899
 
900
  // Finally, we register the fields with WordPress.
963
  'wcal_add_utm_to_links'
964
  );
965
 
966
+ register_setting(
967
+ 'woocommerce_ac_settings',
968
+ 'wcal_delete_coupon_data'
969
+ );
970
+
971
  do_action( 'wcal_add_new_settings' );
972
  }
973
 
1739
  $sent_email_id_pos = strpos( $link_decode, '&' );
1740
  $email_sent_id = substr( $link_decode, 0, $sent_email_id_pos );
1741
 
1742
+ if ( isset( $_GET['c'] ) ) { // phpcs:ignore
1743
+ $decrypt_coupon_code = rawurldecode( sanitize_text_field( wp_unslash( $_GET['c'] ) ) ); //phpcs:ignore
1744
+ $decrypt_coupon_code = str_replace( ' ', '+', $decrypt_coupon_code );
1745
+ $decode_coupon_code = Wcal_Aes_Ctr::decrypt( $decrypt_coupon_code, $crypt_key, 256 );
1746
+
1747
+ wcal_common::wcal_set_cart_session( 'wcal_c', $decode_coupon_code ); // we need to set in session coz we directly apply coupon.
1748
+ set_transient( 'wcal_c', $decode_coupon_code, 5 );
1749
+ } else {
1750
+ $decode_coupon_code = '';
1751
+ }
1752
+
1753
  wcal_common::wcal_set_cart_session( 'email_sent_id', $email_sent_id );
1754
  set_transient( 'wcal_email_sent_id', $email_sent_id, 5 );
1755
 
2301
  'ajax_url' => admin_url( 'admin-ajax.php' ),
2302
  )
2303
  );
2304
+ wp_register_script( 'enhanced', plugins_url() . '/woocommerce/assets/js/admin/wc-enhanced-select.js', array( 'jquery', 'select2' ), WCAL_PLUGIN_VERSION, false );
2305
+
2306
+ wp_localize_script(
2307
+ 'enhanced',
2308
+ 'wc_enhanced_select_params',
2309
+ array(
2310
+ 'i18n_matches_1' => _x( 'One result is available, press enter to select it.', 'enhanced select', 'woocommerce' ),
2311
+ 'i18n_matches_n' => _x( '%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce' ),
2312
+ 'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
2313
+ 'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'woocommerce' ),
2314
+ 'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'woocommerce' ),
2315
+ 'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'woocommerce' ),
2316
+ 'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'woocommerce' ),
2317
+ 'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'woocommerce' ),
2318
+ 'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'woocommerce' ),
2319
+ 'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'woocommerce' ),
2320
+ 'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'woocommerce' ),
2321
+ 'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
2322
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
2323
+ 'search_products_nonce' => wp_create_nonce( 'search-products' ),
2324
+ 'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
2325
+ )
2326
+ );
2327
+
2328
+ wp_enqueue_script( 'enhanced' );
2329
+
2330
+ wp_register_script( 'selectWoo', plugins_url() . '/woocommerce/assets/js/selectWoo/selectWoo.full.js', array( 'jquery' ), WCAL_PLUGIN_VERSION, false );
2331
+ wp_enqueue_script( 'selectWoo' );
2332
+
2333
+ wp_register_script( 'select2', plugins_url() . '/woocommerce/assets/js/select2/select2.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-core' ), WCAL_PLUGIN_VERSION, false );
2334
+ wp_enqueue_script( 'select2' );
2335
+
2336
+ wp_dequeue_script( 'wc-enhanced-select' );
2337
  }
2338
  }
2339
 
2722
  $day_or_hour = isset( $_POST['day_or_hour'] ) ? trim( sanitize_text_field( wp_unslash( $_POST['day_or_hour'] ) ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
2723
  $is_wc_template = empty( $_POST['is_wc_template'] ) ? '0' : '1'; // phpcs:ignore WordPress.Security.NonceVerification
2724
 
2725
+ if ( isset( $_POST['ac_settings_frm'] ) && 'save' === sanitize_text_field( wp_unslash( $_POST['ac_settings_frm'] ) ) ) { // phpcs:ignore
2726
+ $default_value = 0;
2727
+ $coupon_code_id = isset( $_POST['coupon_ids'][0] ) ? sanitize_text_field( wp_unslash( implode( ',', $_POST['coupon_ids'] ) ) ) : ''; // phpcs:ignore
2728
+ $unique_coupon = ( empty( $_POST['unique_coupon'] ) ) ? '0' : '1'; // phpcs:ignore WordPress.Security.NonceVerification
2729
+ $coupon_code_options = self::wcal_coupon_options();
2730
 
2731
  $insert_template_successfuly = $wpdb->query( //phpcs:ignore
2732
  $wpdb->prepare(
2733
+ 'INSERT INTO `' . $wpdb->prefix . 'ac_email_templates_lite` (subject, body, frequency, day_or_hour, template_name, is_wc_template, default_template, wc_email_header, coupon_code, individual_use, generate_unique_coupon_code, discount, discount_type, discount_shipping, discount_expiry ) VALUES ( %s, %s, %d, %s, %s, %s, %d, %s, %s, %s, %s, %s, %s, %s, %s )',
2734
  $woocommerce_ac_email_subject,
2735
  $woocommerce_ac_email_body,
2736
  $email_frequency,
2738
  $woocommerce_ac_template_name,
2739
  $is_wc_template,
2740
  $default_value,
2741
+ $woocommerce_ac_email_header,
2742
+ $coupon_code_id,
2743
+ $coupon_code_options['individual_use'],
2744
+ $unique_coupon,
2745
+ $coupon_code_options['coupon_amount'],
2746
+ $coupon_code_options['discount_type'],
2747
+ $coupon_code_options['discount_shipping'],
2748
+ $coupon_code_options['coupon_expiry']
2749
  )
2750
  );
2751
  }
2768
  $default_value = '1';
2769
  }
2770
  }
2771
+ $coupon_code_id = isset( $_POST['coupon_ids'][0] ) ? sanitize_text_field( wp_unslash( implode( ',', $_POST['coupon_ids'] ) ) ) : ''; // phpcs:ignore
2772
+ $unique_coupon = ( empty( $_POST['unique_coupon'] ) ) ? '0' : '1'; // phpcs:ignore
2773
+ $coupon_code_options = self::wcal_coupon_options();
2774
 
2775
  $update_template_successfuly = $wpdb->query( //phpcs:ignore
2776
  $wpdb->prepare(
2777
+ 'UPDATE `' . $wpdb->prefix . 'ac_email_templates_lite` SET subject = %s, body = %s, frequency = %d, day_or_hour = %s, template_name = %s, is_wc_template = %s, default_template = %d, wc_email_header = %s,coupon_code = %s, individual_use =%s, generate_unique_coupon_code = %s, discount = %s, discount_type = %s, discount_shipping =%s, discount_expiry = %s WHERE id = %d',
2778
  $woocommerce_ac_email_subject,
2779
  $woocommerce_ac_email_body,
2780
  $email_frequency,
2783
  $is_wc_template,
2784
  $default_value,
2785
  $woocommerce_ac_email_header,
2786
+ $coupon_code_id,
2787
+ $coupon_code_options['individual_use'],
2788
+ $unique_coupon,
2789
+ $coupon_code_options['coupon_amount'],
2790
+ $coupon_code_options['discount_type'],
2791
+ $coupon_code_options['discount_shipping'],
2792
+ $coupon_code_options['coupon_expiry'],
2793
  $id
2794
  )
2795
  );
3603
  </span>
3604
  </td>
3605
  </tr>
3606
+ <?php include_once 'views/wcal-email-coupon.php'; ?>
3607
  <tr>
3608
  <th>
3609
  <label for="woocommerce_ac_email_preview"><b><?php esc_html_e( 'Send a test email to:', 'woocommerce-abandoned-cart' ); ?></b></label>
3984
  die();
3985
  }
3986
  }
3987
+
3988
+ /**
3989
+ * Return the coupon settings in the template.
3990
+ *
3991
+ * @return $coupon_code_options - Coupon code settings.
3992
+ */
3993
+ public static function wcal_coupon_options() {
3994
+
3995
+ $coupon_expiry = '';
3996
+ if ( isset( $_POST['wcal_coupon_expiry'] ) && '' !== $_POST['wcal_coupon_expiry'] ) { // phpcs:ignore WordPress.Security.NonceVerification
3997
+ $coupon_expiry = sanitize_text_field( wp_unslash( $_POST['wcal_coupon_expiry'] ) ); // phpcs:ignore WordPress.Security.NonceVerification
3998
+ }
3999
+
4000
+ if ( isset( $_POST['expiry_day_or_hour'] ) && '' !== $_POST['expiry_day_or_hour'] ) { // phpcs:ignore WordPress.Security.NonceVerification
4001
+ $expiry_day_or_hour = sanitize_text_field( wp_unslash( $_POST['expiry_day_or_hour'] ) ); // phpcs:ignore WordPress.Security.NonceVerification
4002
+ }
4003
+ $coupon_expiry = $coupon_expiry . '-' . $expiry_day_or_hour;
4004
+
4005
+ $discount_shipping = isset( $_POST['wcal_allow_free_shipping'] ) && '' !== $_POST['wcal_allow_free_shipping'] ? 'yes' : 'off'; // phpcs:ignore WordPress.Security.NonceVerification
4006
+ $individual_use = empty( $_POST['individual_use'] ) ? '0' : '1'; // phpcs:ignore WordPress.Security.NonceVerification
4007
+ $discount_type = isset( $_POST['wcal_discount_type'] ) && '' !== $_POST['wcal_discount_type'] ? sanitize_text_field( wp_unslash( $_POST['wcal_discount_type'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
4008
+ $coupon_amount = isset( $_POST['wcal_coupon_amount'] ) && '' !== $_POST['wcal_coupon_amount'] ? sanitize_text_field( wp_unslash( $_POST['wcal_coupon_amount'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
4009
+
4010
+ $coupon_code_options = array(
4011
+ 'discount_type' => $discount_type,
4012
+ 'coupon_amount' => $coupon_amount,
4013
+ 'coupon_expiry' => $coupon_expiry,
4014
+ 'discount_shipping' => $discount_shipping,
4015
+ 'individual_use' => $individual_use,
4016
+ );
4017
+
4018
+ return $coupon_code_options;
4019
+ }
4020
+ /**
4021
+ * It will search for the coupon code. It is called on the add / edit template page.
4022
+ *
4023
+ * @hook wp_ajax_wcal_json_find_coupons
4024
+ * @param string $x - coupon code string.
4025
+ * @param array $post_types Post type which we want to search.
4026
+ * @since 5.11.0.
4027
+ */
4028
+ public function wcal_json_find_coupons( $x = '', $post_types = array( 'shop_coupon' ) ) {
4029
+ check_ajax_referer( 'search-products', 'security' );
4030
+ $term = (string) urldecode( stripslashes( wp_strip_all_tags( wp_unslash( $_GET['term'] ) ) ) ); //phpcs:ignore
4031
+ if ( empty( $term ) ) {
4032
+ die();
4033
+ }
4034
+ if ( is_numeric( $term ) ) {
4035
+ $args = array(
4036
+ 'post_type' => $post_types,
4037
+ 'post_status' => 'publish',
4038
+ 'posts_per_page' => -1,
4039
+ 'post__in' => array( 0, $term ),
4040
+ 'fields' => 'ids',
4041
+ );
4042
+ $args2 = array(
4043
+ 'post_type' => $post_types,
4044
+ 'post_status' => 'publish',
4045
+ 'posts_per_page' => -1,
4046
+ 'post_parent' => $term,
4047
+ 'fields' => 'ids',
4048
+ );
4049
+ $args3 = array(
4050
+ 'post_type' => $post_types,
4051
+ 'post_status' => 'publish',
4052
+ 'posts_per_page' => -1,
4053
+ 'meta_query' => array( // phpcs:ignore
4054
+ array(
4055
+ 'key' => '_sku',
4056
+ 'value' => $term,
4057
+ 'compare' => 'LIKE',
4058
+ ),
4059
+ ),
4060
+ 'fields' => 'ids',
4061
+ );
4062
+ $posts = array_unique( array_merge( get_posts( $args ), get_posts( $args2 ), get_posts( $args3 ) ) );
4063
+ } else {
4064
+ $args = array(
4065
+ 'post_type' => $post_types,
4066
+ 'post_status' => 'publish',
4067
+ 'posts_per_page' => -1,
4068
+ 's' => $term,
4069
+ 'fields' => 'ids',
4070
+ );
4071
+ $args2 = array(
4072
+ 'post_type' => $post_types,
4073
+ 'post_status' => 'publish',
4074
+ 'posts_per_page' => -1,
4075
+ 'meta_query' => array( // phpcs:ignore
4076
+ array(
4077
+ 'key' => '_sku',
4078
+ 'value' => $term,
4079
+ 'compare' => 'LIKE',
4080
+ ),
4081
+ ),
4082
+ 'fields' => 'ids',
4083
+ );
4084
+ $posts = array_unique( array_merge( get_posts( $args ), get_posts( $args2 ) ) );
4085
+ }
4086
+ $found_products = array();
4087
+ if ( $posts ) {
4088
+ foreach ( $posts as $post ) {
4089
+ $sku = get_post_meta( $post, '_sku', true );
4090
+ $wcal_product_sku = apply_filters( 'wcal_product_sku', $sku );
4091
+ if ( false !== $wcal_product_sku && '' !== $wcal_product_sku ) {
4092
+ if ( isset( $sku ) && $sku ) {
4093
+ $sku = ' ( SKU: ' . $sku . ' )';
4094
+ }
4095
+ $found_products[ $post ] = get_the_title( $post ) . ' &ndash; #' . $post . $sku;
4096
+ } else {
4097
+ $found_products[ $post ] = get_the_title( $post ) . ' &ndash; #' . $post;
4098
+ }
4099
+ }
4100
+ }
4101
+ echo wp_json_encode( $found_products );
4102
+ die();
4103
+ }
4104
+
4105
+ /**
4106
+ * Option for deleting the plugin data upon uninstall.
4107
+ *
4108
+ * @param array $args Argument for adding field details.
4109
+ * @since 8.3
4110
+ */
4111
+ public static function wcal_deleting_coupon_data( $args ) {
4112
+ $wcal_delete_coupon_data = get_option( 'wcal_delete_coupon_data', '' );
4113
+ if ( isset( $wcal_delete_coupon_data ) && '' === $wcal_delete_coupon_data ) {
4114
+ $wcal_delete_coupon_data = 'off';
4115
+ wp_clear_scheduled_hook( 'woocommerce_ac_delete_coupon_action' );
4116
+ } else {
4117
+ if ( ! wp_next_scheduled( 'woocommerce_ac_delete_coupon_action' ) ) {
4118
+ wp_schedule_event( time(), 'wcal_15_days', 'woocommerce_ac_delete_coupon_action' );
4119
+ }
4120
+ }
4121
+
4122
+ ?>
4123
+ <input type="checkbox" id="wcal_delete_coupon_data" name="wcal_delete_coupon_data" value="on" <?php echo checked( 'on', $wcal_delete_coupon_data, false ); ?> />
4124
+ <label for="wcal_delete_coupon_data"> <?php echo esc_attr( $args[0] ); ?></label>
4125
+ <a >
4126
+ <?php
4127
+ }
4128
+ /**
4129
+ * It will delete the expired and used coupon codes.
4130
+ *
4131
+ * @hook wp_ajax_wcal_change_manual_email_data
4132
+ * @since: 5.11.0
4133
+ */
4134
+ public static function wcal_delete_expired_used_coupon_code() {
4135
+
4136
+ global $wpdb;
4137
+
4138
+ $expired_coupons = self::wcal_fetch_expired_coupons();
4139
+ $used_coupons = self::wcal_fetch_used_coupons();
4140
+ $coupons = array_unique( array_merge( $expired_coupons, $used_coupons ) );
4141
+ $coupon_count = count( $coupons );
4142
+
4143
+ if ( $coupon_count ) {
4144
+ $coupons_ids = implode( ',', $coupons );
4145
+ $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE post_id IN(" . $coupons_ids . ')' );//phpcs:ignore
4146
+ $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE ID IN(" . $coupons_ids . ')' );//phpcs:ignore
4147
+ }
4148
+
4149
+ // translators: %1$s: Coupons Deleted, %2$s: Deleted coupons count'.
4150
+ wp_send_json_success( sprintf( __( '%1$s: %2$d', 'woo-cart-abandonment-recovery' ), 'Coupons Deleted', $coupon_count ) );
4151
+ }
4152
+
4153
+ /**
4154
+ * Coupon deletion manual button.
4155
+ *
4156
+ * @param array $args - Arguments for the setting.
4157
+ */
4158
+ public static function wcal_deleting_coupon_data_manually( $args ) {
4159
+ ?>
4160
+ <input type="button" class="button-secondary" id="wcal_delete_coupons" value="<?php esc_html_e( 'Delete', 'woocommerce-ac' ); ?>" >
4161
+ <label> <?php echo esc_attr( $args[0] ); ?></label>
4162
+ <br>
4163
+ <span class="wcal-spinner" style="display:none;">
4164
+ <img class="ajax_img" src="<?php echo esc_attr( WCAL_PLUGIN_URL . '/assets/images/ajax-loader.gif' ); ?>" />
4165
+ </span>
4166
+ <span class="wcal-coupon-response-msg"></span>
4167
+ <?php
4168
+ }
4169
+ /**
4170
+ * It will fetch all expired coupons
4171
+ *
4172
+ * @hook wp_ajax_wcal_change_manual_email_data.
4173
+ * @since: 5.11
4174
+ */
4175
+ public static function wcal_fetch_expired_coupons() {
4176
+ $coupon_ids = array();
4177
+
4178
+ $args = array(
4179
+ 'posts_per_page' => -1,
4180
+ 'post_type' => 'shop_coupon',
4181
+ 'post_status' => 'publish',
4182
+ 'meta_query' => array( //phpcs:ignore
4183
+ 'relation' => 'AND',
4184
+ array(
4185
+ 'key' => 'date_expires',
4186
+ 'value' => strtotime( 'today' ),
4187
+ 'compare' => '<=',
4188
+ ),
4189
+ array(
4190
+ 'key' => 'date_expires',
4191
+ 'value' => '',
4192
+ 'compare' => '!=',
4193
+ ),
4194
+ array(
4195
+ 'key' => 'wcal_created_by',
4196
+ 'value' => 'wcal',
4197
+ 'compare' => '=',
4198
+ ),
4199
+ ),
4200
+ );
4201
+
4202
+ $args = array(
4203
+ 'posts_per_page' => -1,
4204
+ 'post_type' => 'shop_coupon',
4205
+ 'post_status' => 'publish',
4206
+ 'meta_query' => array( // phpcs:ignore
4207
+ 'relation' => 'AND',
4208
+ array(
4209
+ 'key' => 'date_expires',
4210
+ 'value' => strtotime( 'today' ),
4211
+ 'compare' => '<=',
4212
+ ),
4213
+ array(
4214
+ 'key' => 'date_expires',
4215
+ 'value' => '',
4216
+ 'compare' => '!=',
4217
+ ),
4218
+ array(
4219
+ 'key' => 'wcal_created_by',
4220
+ 'value' => 'wcal',
4221
+ 'compare' => '=',
4222
+ ),
4223
+ ),
4224
+ );
4225
+ $coupons = get_posts( $args );
4226
+ if ( ! empty( $coupons ) ) {
4227
+ $current_time = current_time( 'timestamp' ); // phpcs:ignore
4228
+
4229
+ foreach ( $coupons as $coupon ) {
4230
+ array_push( $coupon_ids, $coupon->ID );
4231
+ }
4232
+ }
4233
+
4234
+ return $coupon_ids;
4235
+ }
4236
+
4237
+ /**
4238
+ * It will fetch all used coupons.
4239
+ *
4240
+ * @hook wp_ajax_wcal_change_manual_email_data
4241
+ * @since: 4.2
4242
+ */
4243
+ public static function wcal_fetch_used_coupons() {
4244
+
4245
+ $coupon_ids = array();
4246
+ $args = array(
4247
+ 'posts_per_page' => -1,
4248
+ 'post_type' => 'shop_coupon',
4249
+ 'post_status' => 'publish',
4250
+ 'meta_query' => array( // phpcs:ignore
4251
+ 'relation' => 'AND',
4252
+ array(
4253
+ 'key' => 'usage_count',
4254
+ 'value' => 0,
4255
+ 'compare' => '>',
4256
+ ),
4257
+ array(
4258
+ 'key' => 'wcal_created_by',
4259
+ 'value' => 'wcal',
4260
+ 'compare' => '=',
4261
+ ),
4262
+ ),
4263
+ );
4264
+
4265
+ $coupons = get_posts( $args );
4266
+ if ( ! empty( $coupons ) ) {
4267
+ foreach ( $coupons as $coupon ) {
4268
+ array_push( $coupon_ids, $coupon->ID );
4269
+ }
4270
+ }
4271
+ return $coupon_ids;
4272
+ }
4273
+ /**
4274
+ * It will create the cron job interval.
4275
+ * Default value will be 15 minutes.
4276
+ * If customer has changed the cron job interval time from the settings then it will be considered.
4277
+ *
4278
+ * @param array $schedules Array of all schedule events.
4279
+ * @return array $schedule Array of new added schedule event.
4280
+ * @since 5.0
4281
+ */
4282
+ public static function wcal_add_cron_schedule( $schedules ) {
4283
+ $duration = get_option( 'wcal_cron_time_duration' );
4284
+ if ( isset( $duration ) && $duration > 0 ) {
4285
+ $duration_in_seconds = $duration * 60;
4286
+ } else {
4287
+ $duration_in_seconds = 900;
4288
+ }
4289
+ $schedules['15_minutes'] = array(
4290
+ 'interval' => $duration_in_seconds, // 15 minutes in seconds
4291
+ 'display' => __( 'Once Every Fifteen Minutes' ),
4292
+ );
4293
+
4294
+ $schedules['wcal_15_days'] = array(
4295
+ 'interval' => 1296000, // 15 days in seconds
4296
+ 'display' => __( 'Once Every Fifteen Days' ),
4297
+ );
4298
+ return $schedules;
4299
+ }
4300
+
4301
+ /**
4302
+ * Callback for Abandoned cart Coupon settings.
4303
+ */
4304
+ public static function wcal_coupon_callback() {
4305
+ }
4306
+
4307
  }
4308
  }
4309
  $woocommerce_abandon_cart = new woocommerce_abandon_cart_lite();