WooCommerce Cart Abandonment Recovery - Version 1.2.0

Version Description

Download this release

Release Info

Developer rohitrpatil
Plugin Icon 128x128 WooCommerce Cart Abandonment Recovery
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.9 to 1.2.0

admin/assets/css/admin-cart-abandonment-rtl.css CHANGED
@@ -1,4 +1,3 @@
1
-
2
  .wcf-ca-ibox {
3
  clear: both;
4
  margin-bottom: 25px;
@@ -399,4 +398,5 @@
399
 
400
  .wcf-sub-heading {
401
  font-weight: 400;
402
- }
 
 
1
  .wcf-ca-ibox {
2
  clear: both;
3
  margin-bottom: 25px;
398
 
399
  .wcf-sub-heading {
400
  font-weight: 400;
401
+ }
402
+
admin/assets/css/admin-cart-abandonment.css CHANGED
@@ -1,4 +1,3 @@
1
-
2
  .wcf-ca-ibox {
3
  clear: both;
4
  margin-bottom: 25px;
@@ -399,4 +398,5 @@
399
 
400
  .wcf-sub-heading {
401
  font-weight: 400;
402
- }
 
 
1
  .wcf-ca-ibox {
2
  clear: both;
3
  margin-bottom: 25px;
398
 
399
  .wcf-sub-heading {
400
  font-weight: 400;
401
+ }
402
+
admin/assets/js/admin-email-templates.js CHANGED
@@ -83,14 +83,16 @@
83
 
84
  }
85
  }
 
86
 
87
  EmailTemplatesAdmin = {
88
 
 
89
  init: function () {
90
 
91
  $(document).on('click', '#wcf_preview_email', EmailTemplatesAdmin.send_test_email);
92
  $(document).on('click', '.wcf-ca-switch.wcf-toggle-template-status', EmailTemplatesAdmin.toggle_activate_template);
93
-
94
  var coupon_child_fields = "#wcf_email_discount_type, #wcf_email_discount_amount, #wcf_email_coupon_expiry_date, #wcf_free_shipping_coupon, #wcf_auto_coupon_apply, #wcf_individual_use_only";
95
  $(coupon_child_fields).closest('tr').toggle($("#wcf_override_global_coupon").is(":checked"));
96
  $(document).on('click', '#wcf_override_global_coupon', function () {
@@ -153,17 +155,41 @@
153
  $(".wcf-ca-error-msg").delay(2000).fadeOut();
154
  },
155
 
156
- toggle_activate_template: function () {
157
 
158
  var $switch, state, new_state;
159
  $switch = $(this);
160
  state = $switch.attr('wcf-ca-template-switch');
161
- new_state = state === 'on' ? 'off' : 'on';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
 
 
 
 
 
 
163
  $("#wcf_activate_email_template").val(new_state == 'on' ? 1 : 0);
164
  $switch.attr('wcf-ca-template-switch', new_state);
165
  }
166
-
167
  }
168
 
169
  ZapierSettings = {
@@ -189,14 +215,14 @@
189
  datetime += ' '+now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
190
  if ($.trim(zapier_webhook_url) !== "") {
191
  var sample_data = {
192
- "first_name": CartFlowsCADetails.name,
193
- "last_name": CartFlowsCADetails.surname,
194
- "email": CartFlowsCADetails.email,
195
  "order_status": event.data.order_status,
196
  "checkout_url": window.location.origin + "/checkout/?wcf_ac_token=something",
197
  "coupon_code": "abcgefgh",
198
  "product_names": "Product1, Product2 & Product3",
199
- "cart_total": CartFlowsCADetails.woo_currency_symbol + "20"
200
  };
201
  $.ajax({
202
  url: zapier_webhook_url,
83
 
84
  }
85
  }
86
+
87
 
88
  EmailTemplatesAdmin = {
89
 
90
+
91
  init: function () {
92
 
93
  $(document).on('click', '#wcf_preview_email', EmailTemplatesAdmin.send_test_email);
94
  $(document).on('click', '.wcf-ca-switch.wcf-toggle-template-status', EmailTemplatesAdmin.toggle_activate_template);
95
+ $(document).on('click', '.wcar-switch-grid', EmailTemplatesAdmin.toggle_activate_template_on_grid);
96
  var coupon_child_fields = "#wcf_email_discount_type, #wcf_email_discount_amount, #wcf_email_coupon_expiry_date, #wcf_free_shipping_coupon, #wcf_auto_coupon_apply, #wcf_individual_use_only";
97
  $(coupon_child_fields).closest('tr').toggle($("#wcf_override_global_coupon").is(":checked"));
98
  $(document).on('click', '#wcf_override_global_coupon', function () {
155
  $(".wcf-ca-error-msg").delay(2000).fadeOut();
156
  },
157
 
158
+ toggle_activate_template_on_grid: function () {
159
 
160
  var $switch, state, new_state;
161
  $switch = $(this);
162
  state = $switch.attr('wcf-ca-template-switch');
163
+ var css = (state === 'on') ? 'green' : 'red';
164
+ var nonce = wcf_ca_details.email_toggle_button_nonce;
165
+
166
+ $.post(
167
+ ajaxurl, {
168
+ action: 'activate_email_templates',
169
+ id: $(this).attr('id'),
170
+ state: state,
171
+ security: nonce
172
+ }, function (response) {
173
+
174
+ $("#wcf_activate_email_template").val(new_state == 'on' ? 1 : 0);
175
+
176
+ $(".wcar_tmpl_response_msg").remove();
177
+
178
+ $("<span class='wcar_tmpl_response_msg'> " + response.data + " </span>").insertAfter($switch).delay(2000).fadeOut().css('color', css);
179
+
180
+ }
181
+ );
182
+ },
183
 
184
+
185
+ toggle_activate_template: function () {
186
+ var $switch, state, new_state;
187
+ $switch = $(this);
188
+ state = $switch.attr('wcf-ca-template-switch');
189
+ new_state = state === 'on' ? 'off' : 'on';
190
  $("#wcf_activate_email_template").val(new_state == 'on' ? 1 : 0);
191
  $switch.attr('wcf-ca-template-switch', new_state);
192
  }
 
193
  }
194
 
195
  ZapierSettings = {
215
  datetime += ' '+now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
216
  if ($.trim(zapier_webhook_url) !== "") {
217
  var sample_data = {
218
+ "first_name": wcf_ca_details.name,
219
+ "last_name": wcf_ca_details.surname,
220
+ "email": wcf_ca_details.email,
221
  "order_status": event.data.order_status,
222
  "checkout_url": window.location.origin + "/checkout/?wcf_ac_token=something",
223
  "coupon_code": "abcgefgh",
224
  "product_names": "Product1, Product2 & Product3",
225
+ "cart_total": wcf_ca_details.woo_currency_symbol + "20"
226
  };
227
  $.ajax({
228
  url: zapier_webhook_url,
admin/assets/js/admin-mce.js CHANGED
@@ -8,7 +8,7 @@
8
  editor.addButton(
9
  'cartflows_ac', {
10
  type: 'menubutton',
11
- text: 'CartFlows Field',
12
  icon: false,
13
  menu: [
14
  {
8
  editor.addButton(
9
  'cartflows_ac', {
10
  type: 'menubutton',
11
+ text: 'WCAR Fields',
12
  icon: false,
13
  menu: [
14
  {
assets/images/hoodie.jpg CHANGED
File without changes
assets/images/polo.jpg CHANGED
File without changes
changelog.txt CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  Version 1.1.9 - Thursday, 19th September 2019
2
  - New: Option added to ignore users from cart abandonment process.
3
  - New: Filter added to customize the styling of email template table.
1
+ Version 1.2.0 - Monday, 14th October 2019
2
+ - New: Added support for PPOM products.
3
+ - Improvement: Added email activate toggle button on grid.
4
+ - Improvement: Added notice on the checkout page for test emails.
5
+ - Fix: Zero-value orders getting tracked.
6
+ - Fix: Disable tracking for the custom user roles.
7
+
8
  Version 1.1.9 - Thursday, 19th September 2019
9
  - New: Option added to ignore users from cart abandonment process.
10
  - New: Filter added to customize the styling of email template table.
classes/class-cartflows-ca-loader.php CHANGED
@@ -66,6 +66,7 @@ if ( ! class_exists( 'CARTFLOWS_CA_Loader' ) ) {
66
  add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
67
 
68
  add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
 
69
  }
70
 
71
  /**
@@ -77,7 +78,7 @@ if ( ! class_exists( 'CARTFLOWS_CA_Loader' ) ) {
77
  define( 'CARTFLOWS_CA_BASE', plugin_basename( CARTFLOWS_CA_FILE ) );
78
  define( 'CARTFLOWS_CA_DIR', plugin_dir_path( CARTFLOWS_CA_FILE ) );
79
  define( 'CARTFLOWS_CA_URL', plugins_url( '/', CARTFLOWS_CA_FILE ) );
80
- define( 'CARTFLOWS_CA_VER', '1.1.9' );
81
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
82
 
83
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
@@ -328,7 +329,6 @@ if ( ! class_exists( 'CARTFLOWS_CA_Loader' ) ) {
328
  function deactivation_reset() {
329
  wp_clear_scheduled_hook( 'cartflows_ca_update_order_status_action' );
330
  }
331
-
332
  }
333
 
334
  /**
66
  add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
67
 
68
  add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
69
+
70
  }
71
 
72
  /**
78
  define( 'CARTFLOWS_CA_BASE', plugin_basename( CARTFLOWS_CA_FILE ) );
79
  define( 'CARTFLOWS_CA_DIR', plugin_dir_path( CARTFLOWS_CA_FILE ) );
80
  define( 'CARTFLOWS_CA_URL', plugins_url( '/', CARTFLOWS_CA_FILE ) );
81
+ define( 'CARTFLOWS_CA_VER', '1.2.0' );
82
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
83
 
84
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
329
  function deactivation_reset() {
330
  wp_clear_scheduled_hook( 'cartflows_ca_update_order_status_action' );
331
  }
 
332
  }
333
 
334
  /**
classes/class-cartflows-ca-settings.php CHANGED
File without changes
classes/class-cartflows-ca-update.php CHANGED
File without changes
languages/woo-cart-abandonment-recovery.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the WooCommerce Cart Abandonment Recovery package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Cart Abandonment Recovery 1.1.9\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
- "POT-Creation-Date: 2019-09-19 09:54:21+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -25,18 +25,18 @@ msgstr ""
25
  "X-Textdomain-Support: yes\n"
26
  "X-Generator: grunt-wp-i18n 1.0.3\n"
27
 
28
- #: classes/class-cartflows-ca-loader.php:134
29
  #. translators: %s: html tags
30
  msgid ""
31
  "The %1$sWooCommerce Cart Abandonment Recovery%2$s plugin requires "
32
  "%1$sWooCommerce%2$s plugin installed & activated."
33
  msgstr ""
34
 
35
- #: classes/class-cartflows-ca-loader.php:144
36
  msgid "Activate WooCommerce"
37
  msgstr ""
38
 
39
- #: classes/class-cartflows-ca-loader.php:152
40
  msgid "Install WooCommerce"
41
  msgstr ""
42
 
@@ -110,12 +110,12 @@ msgid ""
110
  msgstr ""
111
 
112
  #: classes/class-cartflows-ca-settings.php:187
113
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:491
114
  msgid "Discount Type"
115
  msgstr ""
116
 
117
  #: classes/class-cartflows-ca-settings.php:196
118
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:523
119
  msgid "Coupon Amount"
120
  msgstr ""
121
 
@@ -164,19 +164,19 @@ msgstr ""
164
 
165
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:66
166
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:118
167
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:85
168
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:119
169
  msgid "Delete"
170
  msgstr ""
171
 
172
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:70
173
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1554
174
  msgid "Unsubscribe"
175
  msgstr ""
176
 
177
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:184
178
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1696
179
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1751
180
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:168
181
  msgid "Name"
182
  msgstr ""
@@ -186,7 +186,7 @@ msgid "Email"
186
  msgstr ""
187
 
188
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:186
189
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1773
190
  msgid "Cart Total"
191
  msgstr ""
192
 
@@ -198,227 +198,245 @@ msgstr ""
198
  msgid "Time"
199
  msgstr ""
200
 
201
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:119
202
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:859
203
  msgid "This order was abandoned & subsequently recovered."
204
  msgstr ""
205
 
206
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:141
207
  msgid "Mail has been sent successfully!"
208
  msgstr ""
209
 
210
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:143
211
  msgid "Mail sending failed!"
212
  msgstr ""
213
 
214
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:183
215
  msgid "Every Fifteen Minutes"
216
  msgstr ""
217
 
218
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:247
219
  msgid "You have successfully unsubscribed from our email list."
220
  msgstr ""
221
 
222
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:247
223
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:159
224
  msgid "Unsubscribed"
225
  msgstr ""
226
 
227
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:421
 
 
 
 
 
 
228
  msgid "No Thanks"
229
  msgstr ""
230
 
231
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:422
232
  msgid "You won't receive further emails from us, thank you!"
233
  msgstr ""
234
 
235
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:987
236
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:988
237
  msgid "Cart Abandonment"
238
  msgstr ""
239
 
240
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1021
241
  msgid "Items deleted: %d"
242
  msgstr ""
243
 
244
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1038
245
  msgid "User unsubscribed successfully!"
246
  msgstr ""
247
 
248
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1233
249
  msgid "Report"
250
  msgstr ""
251
 
252
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1249
253
  msgid "Follow-Up Emails"
254
  msgstr ""
255
 
256
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1265
257
  msgid "Settings"
258
  msgstr ""
259
 
260
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1516
261
  msgid "there"
262
  msgstr ""
263
 
264
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1688
265
  msgid "Cart Total ( Cart Total + Shipping + Tax )"
266
  msgstr ""
267
 
268
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1695
269
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1750
270
  msgid "Item"
271
  msgstr ""
272
 
273
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1697
274
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1752
275
  msgid "Quantity"
276
  msgstr ""
277
 
278
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1698
279
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1753
280
  msgid "Price"
281
  msgstr ""
282
 
283
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1699
284
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1754
285
  msgid "Line Subtotal"
286
  msgstr ""
287
 
288
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1760
289
  msgid "Discount"
290
  msgstr ""
291
 
292
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1764
293
  msgid "Other"
294
  msgstr ""
295
 
296
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1769
297
  msgid "Shipping"
298
  msgstr ""
299
 
300
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:73
301
  msgid "Edit"
302
  msgstr ""
303
 
304
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:97
305
  msgid "Clone"
306
  msgstr ""
307
 
308
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:183
309
  msgid "Template Name"
310
  msgstr ""
311
 
312
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:184
313
  msgid "Email Subject"
314
  msgstr ""
315
 
316
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:185
317
  msgid "Trigger After"
318
  msgstr ""
319
 
320
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:186
321
- msgid "Is Activated?"
322
  msgstr ""
323
 
324
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:186
 
 
 
 
 
 
 
 
 
 
 
 
325
  msgid "The Email Template has been successfully added."
326
  msgstr ""
327
 
328
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:196
329
  msgid "The Email Template has been cloned successfully."
330
  msgstr ""
331
 
332
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:206
333
  msgid "The Email Template has been successfully deleted."
334
  msgstr ""
335
 
336
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:215
337
  msgid "The Email Template has been successfully updated."
338
  msgstr ""
339
 
340
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:225
341
  msgid "Default Email Templates has been restored successfully."
342
  msgstr ""
343
 
344
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:392
345
  msgid "Activate Template now?"
346
  msgstr ""
347
 
348
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:412
349
  msgid "Template Name:"
350
  msgstr ""
351
 
352
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:427
353
  msgid "Email Subject:"
354
  msgstr ""
355
 
356
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:442
357
  msgid "Email Body:"
358
  msgstr ""
359
 
360
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:471
361
  msgid "Create Coupon"
362
  msgstr ""
363
 
364
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:484
365
  msgid "Allows you to send new coupon only for this template."
366
  msgstr ""
367
 
368
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:541
369
  msgid "Coupon expiry date"
370
  msgstr ""
371
 
372
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:571
373
  msgid "Enter zero (0) to restrict coupon from expiring"
374
  msgstr ""
375
 
376
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:577
377
  msgid "Free Shipping"
378
  msgstr ""
379
 
380
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:590
381
  msgid ""
382
  "Allows you to grant free shipping. A free shipping method must be enabled "
383
  "in your shipping zone and be set to require \"a valid free shipping "
384
  "coupon\". "
385
  msgstr ""
386
 
387
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:597
388
  msgid "Individual use only"
389
  msgstr ""
390
 
391
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:611
392
  msgid ""
393
  "Check this box if the coupon cannot be used in conjunction with other "
394
  "coupons."
395
  msgstr ""
396
 
397
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:618
398
  msgid "Auto Apply Coupon"
399
  msgstr ""
400
 
401
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:632
402
  msgid " Automatically add the coupon to the cart at the checkout."
403
  msgstr ""
404
 
405
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:638
406
  msgid "Send This Email"
407
  msgstr ""
408
 
409
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:671
410
  msgid "after cart is abandoned."
411
  msgstr ""
412
 
413
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:681
414
  msgid "Send Test Email To:"
415
  msgstr ""
416
 
417
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:1006
418
  msgid "Create New Template"
419
  msgstr ""
420
 
421
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:1009
422
  msgid " Restore Default Templates"
423
  msgstr ""
424
 
2
  # This file is distributed under the same license as the WooCommerce Cart Abandonment Recovery package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Cart Abandonment Recovery 1.2.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
+ "POT-Creation-Date: 2019-10-14 11:17:30+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
25
  "X-Textdomain-Support: yes\n"
26
  "X-Generator: grunt-wp-i18n 1.0.3\n"
27
 
28
+ #: classes/class-cartflows-ca-loader.php:135
29
  #. translators: %s: html tags
30
  msgid ""
31
  "The %1$sWooCommerce Cart Abandonment Recovery%2$s plugin requires "
32
  "%1$sWooCommerce%2$s plugin installed & activated."
33
  msgstr ""
34
 
35
+ #: classes/class-cartflows-ca-loader.php:145
36
  msgid "Activate WooCommerce"
37
  msgstr ""
38
 
39
+ #: classes/class-cartflows-ca-loader.php:153
40
  msgid "Install WooCommerce"
41
  msgstr ""
42
 
110
  msgstr ""
111
 
112
  #: classes/class-cartflows-ca-settings.php:187
113
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:519
114
  msgid "Discount Type"
115
  msgstr ""
116
 
117
  #: classes/class-cartflows-ca-settings.php:196
118
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:551
119
  msgid "Coupon Amount"
120
  msgstr ""
121
 
164
 
165
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:66
166
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:118
167
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:84
168
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:118
169
  msgid "Delete"
170
  msgstr ""
171
 
172
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:70
173
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1582
174
  msgid "Unsubscribe"
175
  msgstr ""
176
 
177
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:184
178
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1724
179
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1779
180
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:168
181
  msgid "Name"
182
  msgstr ""
186
  msgstr ""
187
 
188
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:186
189
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1801
190
  msgid "Cart Total"
191
  msgstr ""
192
 
198
  msgid "Time"
199
  msgstr ""
200
 
201
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:121
202
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:886
203
  msgid "This order was abandoned & subsequently recovered."
204
  msgstr ""
205
 
206
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:144
207
  msgid "Mail has been sent successfully!"
208
  msgstr ""
209
 
210
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:146
211
  msgid "Mail sending failed!"
212
  msgstr ""
213
 
214
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:186
215
  msgid "Every Fifteen Minutes"
216
  msgstr ""
217
 
218
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:250
219
  msgid "You have successfully unsubscribed from our email list."
220
  msgstr ""
221
 
222
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:250
223
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:159
224
  msgid "Unsubscribed"
225
  msgstr ""
226
 
227
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:402
228
+ msgid ""
229
+ "This checkout page is generated by WooCommerce Cart Abandonment Recovery "
230
+ "plugin from test mail."
231
+ msgstr ""
232
+
233
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:444
234
  msgid "No Thanks"
235
  msgstr ""
236
 
237
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:445
238
  msgid "You won't receive further emails from us, thank you!"
239
  msgstr ""
240
 
241
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1014
242
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1015
243
  msgid "Cart Abandonment"
244
  msgstr ""
245
 
246
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1048
247
  msgid "Items deleted: %d"
248
  msgstr ""
249
 
250
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1065
251
  msgid "User unsubscribed successfully!"
252
  msgstr ""
253
 
254
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1260
255
  msgid "Report"
256
  msgstr ""
257
 
258
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1276
259
  msgid "Follow-Up Emails"
260
  msgstr ""
261
 
262
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1292
263
  msgid "Settings"
264
  msgstr ""
265
 
266
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1543
267
  msgid "there"
268
  msgstr ""
269
 
270
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1716
271
  msgid "Cart Total ( Cart Total + Shipping + Tax )"
272
  msgstr ""
273
 
274
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1723
275
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1778
276
  msgid "Item"
277
  msgstr ""
278
 
279
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1725
280
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1780
281
  msgid "Quantity"
282
  msgstr ""
283
 
284
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1726
285
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1781
286
  msgid "Price"
287
  msgstr ""
288
 
289
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1727
290
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1782
291
  msgid "Line Subtotal"
292
  msgstr ""
293
 
294
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1788
295
  msgid "Discount"
296
  msgstr ""
297
 
298
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1792
299
  msgid "Other"
300
  msgstr ""
301
 
302
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1797
303
  msgid "Shipping"
304
  msgstr ""
305
 
306
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:72
307
  msgid "Edit"
308
  msgstr ""
309
 
310
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:96
311
  msgid "Clone"
312
  msgstr ""
313
 
314
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:182
315
  msgid "Template Name"
316
  msgstr ""
317
 
318
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:183
319
  msgid "Email Subject"
320
  msgstr ""
321
 
322
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:184
323
  msgid "Trigger After"
324
  msgstr ""
325
 
326
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:185
327
+ msgid "Activate Template"
328
  msgstr ""
329
 
330
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:146
331
+ msgid "Something went wrong"
332
+ msgstr ""
333
+
334
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:153
335
+ msgid "Activated"
336
+ msgstr ""
337
+
338
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:156
339
+ msgid "Deactivated"
340
+ msgstr ""
341
+
342
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:214
343
  msgid "The Email Template has been successfully added."
344
  msgstr ""
345
 
346
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:224
347
  msgid "The Email Template has been cloned successfully."
348
  msgstr ""
349
 
350
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:234
351
  msgid "The Email Template has been successfully deleted."
352
  msgstr ""
353
 
354
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:243
355
  msgid "The Email Template has been successfully updated."
356
  msgstr ""
357
 
358
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:253
359
  msgid "Default Email Templates has been restored successfully."
360
  msgstr ""
361
 
362
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:420
363
  msgid "Activate Template now?"
364
  msgstr ""
365
 
366
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:440
367
  msgid "Template Name:"
368
  msgstr ""
369
 
370
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:455
371
  msgid "Email Subject:"
372
  msgstr ""
373
 
374
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:470
375
  msgid "Email Body:"
376
  msgstr ""
377
 
378
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:499
379
  msgid "Create Coupon"
380
  msgstr ""
381
 
382
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:512
383
  msgid "Allows you to send new coupon only for this template."
384
  msgstr ""
385
 
386
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:569
387
  msgid "Coupon expiry date"
388
  msgstr ""
389
 
390
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:599
391
  msgid "Enter zero (0) to restrict coupon from expiring"
392
  msgstr ""
393
 
394
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:605
395
  msgid "Free Shipping"
396
  msgstr ""
397
 
398
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:618
399
  msgid ""
400
  "Allows you to grant free shipping. A free shipping method must be enabled "
401
  "in your shipping zone and be set to require \"a valid free shipping "
402
  "coupon\". "
403
  msgstr ""
404
 
405
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:625
406
  msgid "Individual use only"
407
  msgstr ""
408
 
409
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:639
410
  msgid ""
411
  "Check this box if the coupon cannot be used in conjunction with other "
412
  "coupons."
413
  msgstr ""
414
 
415
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:646
416
  msgid "Auto Apply Coupon"
417
  msgstr ""
418
 
419
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:660
420
  msgid " Automatically add the coupon to the cart at the checkout."
421
  msgstr ""
422
 
423
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:666
424
  msgid "Send This Email"
425
  msgstr ""
426
 
427
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:699
428
  msgid "after cart is abandoned."
429
  msgstr ""
430
 
431
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:709
432
  msgid "Send Test Email To:"
433
  msgstr ""
434
 
435
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:1034
436
  msgid "Create New Template"
437
  msgstr ""
438
 
439
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:1037
440
  msgid " Restore Default Templates"
441
  msgstr ""
442
 
modules/cart-abandonment/assets/js/cart-abandonment-tracking.js CHANGED
@@ -76,8 +76,14 @@
76
 
77
  var wcf_phone = jQuery("#billing_phone").val();
78
  var wcf_email = jQuery("#billing_email").val();
 
 
 
 
 
79
  var atposition = wcf_email.indexOf("@");
80
  var dotposition = wcf_email.lastIndexOf(".");
 
81
 
82
  if (typeof wcf_phone === 'undefined' || wcf_phone === null) { //If phone number field does not exist on the Checkout form
83
  wcf_phone = '';
76
 
77
  var wcf_phone = jQuery("#billing_phone").val();
78
  var wcf_email = jQuery("#billing_email").val();
79
+
80
+ if( typeof wcf_email === 'undefined' ){
81
+ return ;
82
+ }
83
+
84
  var atposition = wcf_email.indexOf("@");
85
  var dotposition = wcf_email.lastIndexOf(".");
86
+
87
 
88
  if (typeof wcf_phone === 'undefined' || wcf_phone === null) { //If phone number field does not exist on the Checkout form
89
  wcf_phone = '';
modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php CHANGED
@@ -79,13 +79,15 @@ class Cartflows_Ca_Cart_Abandonment {
79
  if ( ! wp_next_scheduled( 'cartflows_ca_update_order_status_action' ) ) {
80
  wp_schedule_event( time(), 'every_fifteen_minutes', 'cartflows_ca_update_order_status_action' );
81
  }
82
- add_action( 'cartflows_ca_update_order_status_action', array( $this, 'update_order_status' ) );
83
 
 
 
 
 
84
  }
85
 
86
  }
87
 
88
-
89
  /**
90
  * Update the Order status.
91
  *
@@ -130,6 +132,7 @@ class Cartflows_Ca_Cart_Abandonment {
130
 
131
  }
132
 
 
133
  /**
134
  * Send preview emails.
135
  */
@@ -302,6 +305,7 @@ class Cartflows_Ca_Cart_Abandonment {
302
  define( 'WCF_CA_DATETIME_FORMAT', 'Y-m-d H:i:s' );
303
  }
304
 
 
305
  /**
306
  * Restore cart abandonemnt data on checkout page.
307
  *
@@ -332,15 +336,19 @@ class Cartflows_Ca_Cart_Abandonment {
332
  wc_clear_notices();
333
  foreach ( $cart_content as $cart_item ) {
334
 
 
 
 
 
335
  // Skip bundled products when added main product.
336
  if ( isset( $cart_item['bundled_by'] ) ) {
337
  continue;
338
  }
339
 
340
- $id = $cart_item['product_id'];
341
- $qty = $cart_item['quantity'];
 
342
 
343
- $cart_item_data = array();
344
  if ( isset( $cart_item['cartflows_bump'] ) ) {
345
  $cart_item_data['cartflows_bump'] = $cart_item['cartflows_bump'];
346
  }
@@ -382,6 +390,20 @@ class Cartflows_Ca_Cart_Abandonment {
382
  }
383
  return $fields;
384
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  /**
386
  * Load cart abandonemnt tracking script.
387
  *
@@ -395,7 +417,8 @@ class Cartflows_Ca_Cart_Abandonment {
395
  $role = array_shift( $roles );
396
  if ( ! empty( $wcf_ca_ignore_users ) ) {
397
  foreach ( $wcf_ca_ignore_users as $user ) {
398
- $user = lcfirst( $user );
 
399
  if ( $role === $user ) {
400
  return;
401
  }
@@ -691,7 +714,6 @@ class Cartflows_Ca_Cart_Abandonment {
691
  * @since 1.0.0
692
  */
693
  function save_cart_abandonment_data() {
694
-
695
  check_ajax_referer( 'cartflows_save_cart_abandonment_data', 'security' );
696
  $post_data = $this->sanitize_post_data();
697
  if ( isset( $post_data['wcf_email'] ) ) {
@@ -721,27 +743,32 @@ class Cartflows_Ca_Cart_Abandonment {
721
  $session_id = md5( uniqid( rand(), true ) );
722
  }
723
 
724
- if ( ( ! is_null( $session_id ) ) && ! is_null( $session_checkout_details ) ) {
725
 
726
- // Updating row in the Database where users Session id = same as prevously saved in Session.
727
- $wpdb->update(
728
- $cart_abandonment_table,
729
- $checkout_details,
730
- array( 'session_id' => $session_id )
731
- );
732
 
733
- } else {
 
 
 
 
 
734
 
735
- $checkout_details['session_id'] = sanitize_text_field( $session_id );
736
- // Inserting row into Database.
737
- $wpdb->insert(
738
- $cart_abandonment_table,
739
- $checkout_details
740
- );
 
 
741
 
742
- // Storing session_id in WooCommerce session.
743
- WC()->session->set( 'wcf_session_id', $session_id );
744
 
 
 
 
745
  }
746
 
747
  wp_send_json_success();
@@ -1541,8 +1568,9 @@ class Cartflows_Ca_Cart_Abandonment {
1541
  $auto_apply_coupon = $email_instance->get_email_template_meta_by_key( $email_data->email_template_id, 'auto_coupon' );
1542
 
1543
  $token_data = array(
1544
- 'wcf_session_id' => $email_data->session_id,
1545
- 'wcf_coupon_code' => isset( $auto_apply_coupon ) && $auto_apply_coupon->meta_value ? $coupon_code : null,
 
1546
  );
1547
 
1548
  $checkout_url = $this->get_checkout_url( $email_data->checkout_id, $token_data );
@@ -1928,10 +1956,6 @@ class Cartflows_Ca_Cart_Abandonment {
1928
  return $result;
1929
  }
1930
 
1931
-
1932
-
1933
-
1934
-
1935
  /**
1936
  * Delete orders from cart abandonment table whose cart total is zero and order status is abandoned.
1937
  */
@@ -1941,7 +1965,7 @@ class Cartflows_Ca_Cart_Abandonment {
1941
  $cart_abandonment_table = $wpdb->prefix . CARTFLOWS_CA_CART_ABANDONMENT_TABLE;
1942
 
1943
  $where = array(
1944
- 'cart_contents' => 'a:0:{}',
1945
  );
1946
 
1947
  $wpdb->delete( $cart_abandonment_table, $where );
79
  if ( ! wp_next_scheduled( 'cartflows_ca_update_order_status_action' ) ) {
80
  wp_schedule_event( time(), 'every_fifteen_minutes', 'cartflows_ca_update_order_status_action' );
81
  }
 
82
 
83
+ // Adding notice to checkout page to inform about test email checkout page.
84
+ add_action( 'woocommerce_before_checkout_form', array( $this, 'test_email_checkout_page' ), 9 );
85
+
86
+ add_action( 'cartflows_ca_update_order_status_action', array( $this, 'update_order_status' ) );
87
  }
88
 
89
  }
90
 
 
91
  /**
92
  * Update the Order status.
93
  *
132
 
133
  }
134
 
135
+
136
  /**
137
  * Send preview emails.
138
  */
305
  define( 'WCF_CA_DATETIME_FORMAT', 'Y-m-d H:i:s' );
306
  }
307
 
308
+
309
  /**
310
  * Restore cart abandonemnt data on checkout page.
311
  *
336
  wc_clear_notices();
337
  foreach ( $cart_content as $cart_item ) {
338
 
339
+ $cart_item_data = array();
340
+ $id = $cart_item['product_id'];
341
+ $qty = $cart_item['quantity'];
342
+
343
  // Skip bundled products when added main product.
344
  if ( isset( $cart_item['bundled_by'] ) ) {
345
  continue;
346
  }
347
 
348
+ if ( isset( $cart_item['ppom'] ) ) {
349
+ $cart_item_data['ppom'] = $cart_item ['ppom'];
350
+ }
351
 
 
352
  if ( isset( $cart_item['cartflows_bump'] ) ) {
353
  $cart_item_data['cartflows_bump'] = $cart_item['cartflows_bump'];
354
  }
390
  }
391
  return $fields;
392
  }
393
+
394
+ /**
395
+ * Add notice to inform user about test email checkout page.
396
+ */
397
+ function test_email_checkout_page() {
398
+
399
+ $wcf_ac_token = filter_input( INPUT_GET, 'wcf_ac_token', FILTER_SANITIZE_STRING );
400
+ $token_data = $this->wcf_decode_token( $wcf_ac_token );
401
+ if ( is_checkout() && ! is_wc_endpoint_url() && isset( $token_data['wcf_preview_email'] ) && $token_data['wcf_preview_email'] ) {
402
+ wc_print_notice( __( 'This checkout page is generated by WooCommerce Cart Abandonment Recovery plugin from test mail.', 'woo-cart-abandonment-recovery' ), 'notice' );
403
+ }
404
+ }
405
+
406
+
407
  /**
408
  * Load cart abandonemnt tracking script.
409
  *
417
  $role = array_shift( $roles );
418
  if ( ! empty( $wcf_ca_ignore_users ) ) {
419
  foreach ( $wcf_ca_ignore_users as $user ) {
420
+ $user = strtolower( $user );
421
+ $role = preg_replace( '/_/', ' ', $role );
422
  if ( $role === $user ) {
423
  return;
424
  }
714
  * @since 1.0.0
715
  */
716
  function save_cart_abandonment_data() {
 
717
  check_ajax_referer( 'cartflows_save_cart_abandonment_data', 'security' );
718
  $post_data = $this->sanitize_post_data();
719
  if ( isset( $post_data['wcf_email'] ) ) {
743
  $session_id = md5( uniqid( rand(), true ) );
744
  }
745
 
746
+ if ( isset( $checkout_details['cart_total'] ) && $checkout_details['cart_total'] > 0 ) {
747
 
748
+ if ( ( ! is_null( $session_id ) ) && ! is_null( $session_checkout_details ) ) {
 
 
 
 
 
749
 
750
+ // Updating row in the Database where users Session id = same as prevously saved in Session.
751
+ $wpdb->update(
752
+ $cart_abandonment_table,
753
+ $checkout_details,
754
+ array( 'session_id' => $session_id )
755
+ );
756
 
757
+ } else {
758
+
759
+ $checkout_details['session_id'] = sanitize_text_field( $session_id );
760
+ // Inserting row into Database.
761
+ $wpdb->insert(
762
+ $cart_abandonment_table,
763
+ $checkout_details
764
+ );
765
 
766
+ // Storing session_id in WooCommerce session.
767
+ WC()->session->set( 'wcf_session_id', $session_id );
768
 
769
+ }
770
+ } else {
771
+ $wpdb->delete( $cart_abandonment_table, array( 'session_id' => sanitize_key( $session_id ) ) );
772
  }
773
 
774
  wp_send_json_success();
1568
  $auto_apply_coupon = $email_instance->get_email_template_meta_by_key( $email_data->email_template_id, 'auto_coupon' );
1569
 
1570
  $token_data = array(
1571
+ 'wcf_session_id' => $email_data->session_id,
1572
+ 'wcf_coupon_code' => isset( $auto_apply_coupon ) && $auto_apply_coupon->meta_value ? $coupon_code : null,
1573
+ 'wcf_preview_email' => $preview_email ? true : false,
1574
  );
1575
 
1576
  $checkout_url = $this->get_checkout_url( $email_data->checkout_id, $token_data );
1956
  return $result;
1957
  }
1958
 
 
 
 
 
1959
  /**
1960
  * Delete orders from cart abandonment table whose cart total is zero and order status is abandoned.
1961
  */
1965
  $cart_abandonment_table = $wpdb->prefix . CARTFLOWS_CA_CART_ABANDONMENT_TABLE;
1966
 
1967
  $where = array(
1968
+ 'cart_total' => 0,
1969
  );
1970
 
1971
  $wpdb->delete( $cart_abandonment_table, $where );
modules/cart-abandonment/class-cartflows-ca-email-templates-table.php CHANGED
@@ -39,7 +39,6 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
39
  );
40
 
41
  $this->base_url = admin_url( 'admin.php?page=' . WCF_CA_PAGE_NAME . '&action=' . WCF_ACTION_EMAIL_TEMPLATES );
42
-
43
  }
44
 
45
  /**
@@ -183,7 +182,7 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
183
  'template_name' => __( 'Template Name', 'woo-cart-abandonment-recovery' ),
184
  'email_subject' => __( 'Email Subject', 'woo-cart-abandonment-recovery' ),
185
  'trigger_time' => __( 'Trigger After', 'woo-cart-abandonment-recovery' ),
186
- 'is_activated' => __( 'Is Activated?', 'woo-cart-abandonment-recovery' ),
187
 
188
  );
189
  return $columns;
@@ -209,11 +208,21 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
209
  * Column name trigger_time.
210
  *
211
  * @param object $item item.
212
- * @return string
213
  */
214
  function column_is_activated( $item ) {
 
 
 
 
 
 
 
 
 
215
 
216
- return sprintf( '%s', esc_html( $item['is_activated'] ? 'YES' : 'NO' ) );
 
 
217
  }
218
 
219
  /**
@@ -234,6 +243,7 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
234
  * Processes bulk actions
235
  */
236
  function process_bulk_action() {
 
237
  global $wpdb;
238
  $table_name = $wpdb->prefix . CARTFLOWS_CA_EMAIL_TEMPLATE_TABLE;
239
  $action = filter_input( INPUT_GET, 'sub_action', FILTER_SANITIZE_STRING );
@@ -251,8 +261,4 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
251
  }
252
 
253
  }
254
-
255
-
256
  }
257
-
258
-
39
  );
40
 
41
  $this->base_url = admin_url( 'admin.php?page=' . WCF_CA_PAGE_NAME . '&action=' . WCF_ACTION_EMAIL_TEMPLATES );
 
42
  }
43
 
44
  /**
182
  'template_name' => __( 'Template Name', 'woo-cart-abandonment-recovery' ),
183
  'email_subject' => __( 'Email Subject', 'woo-cart-abandonment-recovery' ),
184
  'trigger_time' => __( 'Trigger After', 'woo-cart-abandonment-recovery' ),
185
+ 'is_activated' => __( 'Activate Template', 'woo-cart-abandonment-recovery' ),
186
 
187
  );
188
  return $columns;
208
  * Column name trigger_time.
209
  *
210
  * @param object $item item.
 
211
  */
212
  function column_is_activated( $item ) {
213
+ global $wpdb;
214
+ if ( isset( $item['id'] ) ) {
215
+ $id = $item['id'];
216
+ }
217
+ $is_activated = '';
218
+ $active_status = 0;
219
+ if ( $item && isset( $item['is_activated'] ) ) {
220
+ $active_status = stripslashes( $item['is_activated'] );
221
+ $is_activated = $active_status ? 'on' : 'off';
222
 
223
+ }
224
+ print'<button type="button" id="' . $id . '" class="wcf-ca-switch wcf-toggle-template-status wcar-switch-grid" wcf-ca-template-switch="' . $is_activated . '"> ' . $is_activated . ' </button>';
225
+ print'<input type="hidden" name="wcf_activate_email_template" id="wcf_activate_email_template" value="' . $active_status . '" />';
226
  }
227
 
228
  /**
243
  * Processes bulk actions
244
  */
245
  function process_bulk_action() {
246
+
247
  global $wpdb;
248
  $table_name = $wpdb->prefix . CARTFLOWS_CA_EMAIL_TEMPLATE_TABLE;
249
  $action = filter_input( INPUT_GET, 'sub_action', FILTER_SANITIZE_STRING );
261
  }
262
 
263
  }
 
 
264
  }
 
 
modules/cart-abandonment/class-cartflows-ca-email-templates.php CHANGED
@@ -60,6 +60,10 @@ class Cartflows_Ca_Email_Templates {
60
  return self::$instance;
61
  }
62
 
 
 
 
 
63
  /**
64
  * Constructor function that initializes required actions and hooks
65
  */
@@ -72,9 +76,12 @@ class Cartflows_Ca_Email_Templates {
72
  $this->wpdb = $wpdb;
73
 
74
  add_action( 'admin_enqueue_scripts', __class__ . '::load_email_templates_script', 15 );
 
75
  }
76
 
77
 
 
 
78
  /**
79
  * Add email template JS script.
80
  */
@@ -96,40 +103,61 @@ class Cartflows_Ca_Email_Templates {
96
  CARTFLOWS_CA_VER
97
  );
98
 
99
- $vars = array(
100
- 'settings_url' => add_query_arg(
101
- array(
102
- 'page' => WCF_CA_PAGE_NAME,
103
- 'action' => WCF_ACTION_SETTINGS,
104
- ),
105
- admin_url( '/admin.php' )
106
- ),
107
- );
108
-
109
- wp_localize_script( 'cartflows-ca-email-tmpl-settings', 'CAEmailTemplate', $vars );
110
-
111
  $current_user = wp_get_current_user();
112
  $vars = array(
113
- 'email' => $current_user->user_email,
114
- 'name' => $current_user->user_firstname,
115
- 'surname' => $current_user->user_lastname,
116
- 'phone' => get_user_meta( $current_user->ID, 'billing_phone', true ),
117
- 'billing_company' => get_user_meta( $current_user->ID, 'billing_company', true ),
118
- 'billing_address_1' => get_user_meta( $current_user->ID, 'billing_address_1', true ),
119
- 'billing_address_2' => get_user_meta( $current_user->ID, 'billing_address_2', true ),
120
- 'billing_state' => get_user_meta( $current_user->ID, 'billing_state', true ),
121
- 'billing_postcode' => get_user_meta( $current_user->ID, 'billing_postcode', true ),
122
- 'shipping_first_name' => $current_user->user_firstname,
123
- 'shipping_last_name' => $current_user->user_lastname,
124
- 'shipping_company' => get_user_meta( $current_user->ID, 'shipping_company', true ),
125
- 'shipping_address_1' => get_user_meta( $current_user->ID, 'shipping_address_1', true ),
126
- 'shipping_address_2' => get_user_meta( $current_user->ID, 'shipping_address_2', true ),
127
- 'shipping_city' => get_user_meta( $current_user->ID, 'shipping_city', true ),
128
- 'shipping_state' => get_user_meta( $current_user->ID, 'shipping_state', true ),
129
- 'shipping_postcode' => get_user_meta( $current_user->ID, 'shipping_postcode', true ),
130
- 'woo_currency_symbol' => get_woocommerce_currency_symbol(),
 
131
  );
132
- wp_localize_script( 'cartflows-ca-email-tmpl-settings', 'CartFlowsCADetails', $vars );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
  }
135
 
60
  return self::$instance;
61
  }
62
 
63
+
64
+
65
+
66
+
67
  /**
68
  * Constructor function that initializes required actions and hooks
69
  */
76
  $this->wpdb = $wpdb;
77
 
78
  add_action( 'admin_enqueue_scripts', __class__ . '::load_email_templates_script', 15 );
79
+ add_action( 'wp_ajax_activate_email_templates', array( $this, 'update_email_toggle_button' ) );
80
  }
81
 
82
 
83
+
84
+
85
  /**
86
  * Add email template JS script.
87
  */
103
  CARTFLOWS_CA_VER
104
  );
105
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  $current_user = wp_get_current_user();
107
  $vars = array(
108
+ 'email' => $current_user->user_email,
109
+ 'name' => $current_user->user_firstname,
110
+ 'surname' => $current_user->user_lastname,
111
+ 'phone' => get_user_meta( $current_user->ID, 'billing_phone', true ),
112
+ 'billing_company' => get_user_meta( $current_user->ID, 'billing_company', true ),
113
+ 'billing_address_1' => get_user_meta( $current_user->ID, 'billing_address_1', true ),
114
+ 'billing_address_2' => get_user_meta( $current_user->ID, 'billing_address_2', true ),
115
+ 'billing_state' => get_user_meta( $current_user->ID, 'billing_state', true ),
116
+ 'billing_postcode' => get_user_meta( $current_user->ID, 'billing_postcode', true ),
117
+ 'shipping_first_name' => $current_user->user_firstname,
118
+ 'shipping_last_name' => $current_user->user_lastname,
119
+ 'shipping_company' => get_user_meta( $current_user->ID, 'shipping_company', true ),
120
+ 'shipping_address_1' => get_user_meta( $current_user->ID, 'shipping_address_1', true ),
121
+ 'shipping_address_2' => get_user_meta( $current_user->ID, 'shipping_address_2', true ),
122
+ 'shipping_city' => get_user_meta( $current_user->ID, 'shipping_city', true ),
123
+ 'shipping_state' => get_user_meta( $current_user->ID, 'shipping_state', true ),
124
+ 'shipping_postcode' => get_user_meta( $current_user->ID, 'shipping_postcode', true ),
125
+ 'woo_currency_symbol' => get_woocommerce_currency_symbol(),
126
+ 'email_toggle_button_nonce' => wp_create_nonce( 'activate_email_templates' ),
127
  );
128
+ wp_localize_script( 'cartflows-ca-email-tmpl-settings', 'wcf_ca_details', $vars );
129
+
130
+ }
131
+
132
+
133
+ /**
134
+ * Update the activate email template toggle button.
135
+ */
136
+ public function update_email_toggle_button() {
137
+
138
+ check_ajax_referer( 'activate_email_templates', 'security' );
139
+ global $wpdb;
140
+ $cart_abandonment_template_table_name = $wpdb->prefix . CARTFLOWS_CA_EMAIL_TEMPLATE_TABLE;
141
+
142
+ $id = filter_input( INPUT_POST, 'id', FILTER_VALIDATE_INT );
143
+
144
+ $is_activated = filter_input( INPUT_POST, 'state', FILTER_SANITIZE_STRING );
145
+
146
+ $response = __( 'Something went wrong', 'woo-cart-abandonment-recovery' );
147
+ if ( ! isset( $is_activated ) || ! isset( $id ) ) {
148
+ wp_send_json_error( $response );
149
+ }
150
+
151
+ if ( $is_activated && 'on' === $is_activated ) {
152
+ $is_activated = 1;
153
+ $response = __( 'Activated', 'woo-cart-abandonment-recovery' );
154
+ } else {
155
+ $is_activated = 0;
156
+ $response = __( 'Deactivated', 'woo-cart-abandonment-recovery' );
157
+ }
158
+
159
+ $wpdb->query( $wpdb->prepare( "UPDATE {$cart_abandonment_template_table_name} SET is_activated = %d WHERE id = %d ", $is_activated, $id ), ARRAY_A ); // phpcs:ignore
160
+ wp_send_json_success( $response );
161
 
162
  }
163
 
modules/cart-abandonment/class-cartflows-ca-module-loader.php CHANGED
File without changes
modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php CHANGED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce, wpcrafter
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, cart abandonment, cart recovery
5
  Requires at least: 4.4
6
- Tested up to: 5.2
7
- Stable tag: 1.1.9
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -128,6 +128,13 @@ Here are few thoughts behind making it available for free:
128
  4. General settings for Email, Webhook (Coupon Code), GDPR
129
 
130
  == Changelog ==
 
 
 
 
 
 
 
131
  = Version 1.1.9 - Thursday, 19th September 2019 =
132
  * New: Option added to ignore users from cart abandonment process.
133
  * New: Filter added to customize the styling of email template table.
@@ -184,4 +191,4 @@ Here are few thoughts behind making it available for free:
184
  = Version 1.0.0 - Monday, 27th May 2019 =
185
  * Initial Release
186
 
187
- == Upgrade Notice ==
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, cart abandonment, cart recovery
5
  Requires at least: 4.4
6
+ Tested up to: 5.2.3
7
+ Stable tag: 1.2.0
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
128
  4. General settings for Email, Webhook (Coupon Code), GDPR
129
 
130
  == Changelog ==
131
+ = Version 1.2.0 - Monday, 14th October 2019 =
132
+ * New: Added support for PPOM products.
133
+ * Improvement: Added email activate toggle button on grid.
134
+ * Improvement: Added notice on the checkout page for test emails.
135
+ * Fix: Zero-value orders getting tracked.
136
+ * Fix: Disable tracking for the custom user roles.
137
+
138
  = Version 1.1.9 - Thursday, 19th September 2019 =
139
  * New: Option added to ignore users from cart abandonment process.
140
  * New: Filter added to customize the styling of email template table.
191
  = Version 1.0.0 - Monday, 27th May 2019 =
192
  * Initial Release
193
 
194
+ == Upgrade Notice ==
uninstall.php CHANGED
File without changes
woo-cart-abandonment-recovery.php CHANGED
@@ -3,12 +3,12 @@
3
  * Plugin Name: WooCommerce Cart Abandonment Recovery
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Recover your lost revenue. Capture email address of users on the checkout page and send follow up emails if they don't complete the purchase.
6
- * Version: 1.1.9
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery
10
  * WC requires at least: 3.0
11
- * WC tested up to: 3.6.3
12
  *
13
  * @package Woocommerce-Cart-Abandonment-Recovery
14
  */
3
  * Plugin Name: WooCommerce Cart Abandonment Recovery
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Recover your lost revenue. Capture email address of users on the checkout page and send follow up emails if they don't complete the purchase.
6
+ * Version: 1.2.0
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery
10
  * WC requires at least: 3.0
11
+ * WC tested up to: 3.7.1
12
  *
13
  * @package Woocommerce-Cart-Abandonment-Recovery
14
  */