WooCommerce Cart Abandonment Recovery - Version 1.1.6

Version Description

Download this release

Release Info

Developer sandesh055
Plugin Icon 128x128 WooCommerce Cart Abandonment Recovery
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  Version 1.1.5 - Tuesday, 9th July 2019
2
  - Fix: Other crons disappearing issue.
3
 
1
+ Version 1.1.6 - Friday, 19th July 2019
2
+ - New: Bundled product support for email checkout URL.
3
+ - Improvement: Added phone number and address while triggering the to webhook.
4
+ - Fix: Creating tables and default settings on activation.
5
+
6
  Version 1.1.5 - Tuesday, 9th July 2019
7
  - Fix: Other crons disappearing issue.
8
 
classes/class-cartflows-ca-loader.php CHANGED
@@ -77,7 +77,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.5' );
81
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
82
 
83
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
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.6' );
81
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
82
 
83
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
classes/class-cartflows-ca-update.php CHANGED
@@ -39,6 +39,17 @@ if ( ! class_exists( 'Cartflows_Ca_Update' ) ) :
39
  add_action( 'admin_init', __CLASS__ . '::init' );
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Init
44
  *
@@ -54,6 +65,7 @@ if ( ! class_exists( 'Cartflows_Ca_Update' ) ) :
54
 
55
  // Update auto saved version number.
56
  if ( ! $saved_version ) {
 
57
  update_option( 'wcf_ca_version', CARTFLOWS_CA_VER );
58
  return;
59
  }
@@ -66,6 +78,8 @@ if ( ! class_exists( 'Cartflows_Ca_Update' ) ) :
66
  // Update auto saved version number.
67
  update_option( 'wcf_ca_version', CARTFLOWS_CA_VER );
68
 
 
 
69
  do_action( 'cartflows_ca_update_after' );
70
  }
71
  }
39
  add_action( 'admin_init', __CLASS__ . '::init' );
40
  }
41
 
42
+ /**
43
+ * Create tables if not exists and seed default settings.
44
+ */
45
+ public static function update_table_with_default_settings() {
46
+
47
+ $cartflows_loader = CARTFLOWS_CA_Loader::get_instance();
48
+ $cartflows_loader->initialize_cart_abandonment_tables();
49
+ $cartflows_loader->update_default_settings();
50
+ }
51
+
52
+
53
  /**
54
  * Init
55
  *
65
 
66
  // Update auto saved version number.
67
  if ( ! $saved_version ) {
68
+ self::update_table_with_default_settings();
69
  update_option( 'wcf_ca_version', CARTFLOWS_CA_VER );
70
  return;
71
  }
78
  // Update auto saved version number.
79
  update_option( 'wcf_ca_version', CARTFLOWS_CA_VER );
80
 
81
+ self::update_table_with_default_settings();
82
+
83
  do_action( 'cartflows_ca_update_after' );
84
  }
85
  }
languages/cartflows-ca.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.5\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
- "POT-Creation-Date: 2019-07-09 12:06:25+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -100,12 +100,12 @@ msgid ""
100
  msgstr ""
101
 
102
  #: classes/class-cartflows-ca-settings.php:172
103
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:491
104
  msgid "Discount Type"
105
  msgstr ""
106
 
107
  #: classes/class-cartflows-ca-settings.php:181
108
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:523
109
  msgid "Coupon Amount"
110
  msgstr ""
111
 
@@ -160,13 +160,13 @@ msgid "Delete"
160
  msgstr ""
161
 
162
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:70
163
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1432
164
  msgid "Unsubscribe"
165
  msgstr ""
166
 
167
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:188
168
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1549
169
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1604
170
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:168
171
  msgid "Name"
172
  msgstr ""
@@ -176,7 +176,7 @@ msgid "Email"
176
  msgstr ""
177
 
178
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:190
179
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1626
180
  msgid "Cart Total"
181
  msgstr ""
182
 
@@ -209,76 +209,76 @@ msgstr ""
209
  msgid "Unsubscribed"
210
  msgstr ""
211
 
212
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:351
213
  msgid "No Thanks"
214
  msgstr ""
215
 
216
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:352
217
  msgid "You won't receive further emails from us, thank you!"
218
  msgstr ""
219
 
220
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:762
221
  msgid "CartFlows says: This order was abandoned & subsequently recovered."
222
  msgstr ""
223
 
224
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:874
225
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:875
226
  msgid "Cart Abandonment"
227
  msgstr ""
228
 
229
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:908
230
  msgid "Items deleted: %d"
231
  msgstr ""
232
 
233
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:925
234
  msgid "User unsubscribed successfully!"
235
  msgstr ""
236
 
237
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1120
238
  msgid "Report"
239
  msgstr ""
240
 
241
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1136
242
  msgid "Follow-Up Emails"
243
  msgstr ""
244
 
245
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1152
246
  msgid "Settings"
247
  msgstr ""
248
 
249
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1402
250
  msgid "there"
251
  msgstr ""
252
 
253
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1548
254
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1603
255
  msgid "Item"
256
  msgstr ""
257
 
258
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1550
259
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1605
260
  msgid "Quantity"
261
  msgstr ""
262
 
263
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1551
264
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1606
265
  msgid "Price"
266
  msgstr ""
267
 
268
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1552
269
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1607
270
  msgid "Line Subtotal"
271
  msgstr ""
272
 
273
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1613
274
  msgid "Discount"
275
  msgstr ""
276
 
277
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1617
278
  msgid "Other"
279
  msgstr ""
280
 
281
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1622
282
  msgid "Shipping"
283
  msgstr ""
284
 
@@ -306,67 +306,67 @@ msgstr ""
306
  msgid "Is Activated?"
307
  msgstr ""
308
 
309
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:187
310
  msgid "The Email Template has been successfully added."
311
  msgstr ""
312
 
313
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:197
314
  msgid "The Email Template has been cloned successfully."
315
  msgstr ""
316
 
317
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:207
318
  msgid "The Email Template has been successfully deleted."
319
  msgstr ""
320
 
321
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:216
322
  msgid "The Email Template has been successfully updated."
323
  msgstr ""
324
 
325
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:226
326
  msgid "Default Email Templates has been restored successfully."
327
  msgstr ""
328
 
329
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:392
330
  msgid "Activate Template now?"
331
  msgstr ""
332
 
333
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:412
334
  msgid "Template Name:"
335
  msgstr ""
336
 
337
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:427
338
  msgid "Email Subject:"
339
  msgstr ""
340
 
341
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:442
342
  msgid "Email Body:"
343
  msgstr ""
344
 
345
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:471
346
  msgid "Create Coupon"
347
  msgstr ""
348
 
349
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:541
350
  msgid "Coupon expiry date"
351
  msgstr ""
352
 
353
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:578
354
  msgid "Send This Email"
355
  msgstr ""
356
 
357
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:611
358
  msgid "after cart is abandoned."
359
  msgstr ""
360
 
361
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:621
362
  msgid "Send Test Email To:"
363
  msgstr ""
364
 
365
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:935
366
  msgid "Create New Template"
367
  msgstr ""
368
 
369
- #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:938
370
  msgid " Restore Default Templates"
371
  msgstr ""
372
 
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.6\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
+ "POT-Creation-Date: 2019-07-19 11:14:46+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
100
  msgstr ""
101
 
102
  #: classes/class-cartflows-ca-settings.php:172
103
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:490
104
  msgid "Discount Type"
105
  msgstr ""
106
 
107
  #: classes/class-cartflows-ca-settings.php:181
108
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:522
109
  msgid "Coupon Amount"
110
  msgstr ""
111
 
160
  msgstr ""
161
 
162
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:70
163
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1444
164
  msgid "Unsubscribe"
165
  msgstr ""
166
 
167
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:188
168
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1563
169
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1618
170
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:168
171
  msgid "Name"
172
  msgstr ""
176
  msgstr ""
177
 
178
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:190
179
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1640
180
  msgid "Cart Total"
181
  msgstr ""
182
 
209
  msgid "Unsubscribed"
210
  msgstr ""
211
 
212
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:357
213
  msgid "No Thanks"
214
  msgstr ""
215
 
216
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:358
217
  msgid "You won't receive further emails from us, thank you!"
218
  msgstr ""
219
 
220
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:773
221
  msgid "CartFlows says: This order was abandoned & subsequently recovered."
222
  msgstr ""
223
 
224
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:885
225
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:886
226
  msgid "Cart Abandonment"
227
  msgstr ""
228
 
229
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:919
230
  msgid "Items deleted: %d"
231
  msgstr ""
232
 
233
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:936
234
  msgid "User unsubscribed successfully!"
235
  msgstr ""
236
 
237
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1131
238
  msgid "Report"
239
  msgstr ""
240
 
241
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1147
242
  msgid "Follow-Up Emails"
243
  msgstr ""
244
 
245
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1163
246
  msgid "Settings"
247
  msgstr ""
248
 
249
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1414
250
  msgid "there"
251
  msgstr ""
252
 
253
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1562
254
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1617
255
  msgid "Item"
256
  msgstr ""
257
 
258
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1564
259
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1619
260
  msgid "Quantity"
261
  msgstr ""
262
 
263
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1565
264
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1620
265
  msgid "Price"
266
  msgstr ""
267
 
268
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1566
269
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1621
270
  msgid "Line Subtotal"
271
  msgstr ""
272
 
273
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1627
274
  msgid "Discount"
275
  msgstr ""
276
 
277
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1631
278
  msgid "Other"
279
  msgstr ""
280
 
281
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1636
282
  msgid "Shipping"
283
  msgstr ""
284
 
306
  msgid "Is Activated?"
307
  msgstr ""
308
 
309
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:186
310
  msgid "The Email Template has been successfully added."
311
  msgstr ""
312
 
313
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:196
314
  msgid "The Email Template has been cloned successfully."
315
  msgstr ""
316
 
317
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:206
318
  msgid "The Email Template has been successfully deleted."
319
  msgstr ""
320
 
321
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:215
322
  msgid "The Email Template has been successfully updated."
323
  msgstr ""
324
 
325
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:225
326
  msgid "Default Email Templates has been restored successfully."
327
  msgstr ""
328
 
329
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:391
330
  msgid "Activate Template now?"
331
  msgstr ""
332
 
333
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:411
334
  msgid "Template Name:"
335
  msgstr ""
336
 
337
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:426
338
  msgid "Email Subject:"
339
  msgstr ""
340
 
341
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:441
342
  msgid "Email Body:"
343
  msgstr ""
344
 
345
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:470
346
  msgid "Create Coupon"
347
  msgstr ""
348
 
349
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:540
350
  msgid "Coupon expiry date"
351
  msgstr ""
352
 
353
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:577
354
  msgid "Send This Email"
355
  msgstr ""
356
 
357
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:610
358
  msgid "after cart is abandoned."
359
  msgstr ""
360
 
361
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:620
362
  msgid "Send Test Email To:"
363
  msgstr ""
364
 
365
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:934
366
  msgid "Create New Template"
367
  msgstr ""
368
 
369
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates.php:937
370
  msgid " Restore Default Templates"
371
  msgstr ""
372
 
modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php CHANGED
@@ -284,6 +284,12 @@ class Cartflows_Ca_Cart_Abandonment {
284
  $woocommerce->cart->empty_cart();
285
  wc_clear_notices();
286
  foreach ( $cart_content as $cart_item ) {
 
 
 
 
 
 
287
  $id = $cart_item['product_id'];
288
  $qty = $cart_item['quantity'];
289
 
@@ -459,15 +465,20 @@ class Cartflows_Ca_Cart_Abandonment {
459
  $trigger_details = array();
460
  $url = get_option( 'wcf_ca_zapier_cart_abandoned_webhook' );
461
 
462
- $other_details = unserialize( $checkout_details->other_fields );
463
- $trigger_details['first_name'] = $other_details['wcf_first_name'];
464
- $trigger_details['last_name'] = $other_details['wcf_last_name'];
465
- $trigger_details['email'] = $checkout_details->email;
466
- $trigger_details['checkout_url'] = $this->get_checkout_url( $checkout_details->checkout_id, $checkout_details->session_id );
467
- $trigger_details['product_names'] = $this->get_comma_separated_products( $checkout_details->cart_contents );
468
- $trigger_details['coupon_code'] = $checkout_details->coupon_code;
469
- $trigger_details['order_status'] = $order_status;
470
- $trigger_details['cart_total'] = $checkout_details->cart_total;
 
 
 
 
 
471
 
472
  $parameters = http_build_query( $trigger_details );
473
  $args = array(
@@ -1392,6 +1403,7 @@ class Cartflows_Ca_Cart_Abandonment {
1392
  if ( filter_var( $email_data->email, FILTER_VALIDATE_EMAIL ) ) {
1393
 
1394
  $checkout_url = $this->get_checkout_url( $email_data->checkout_id, $email_data->session_id );
 
1395
  $other_fields = unserialize( $email_data->other_fields );
1396
 
1397
  $from_email_name = get_option( 'wcf_ca_from_name' );
@@ -1413,7 +1425,7 @@ class Cartflows_Ca_Cart_Abandonment {
1413
 
1414
  if ( $preview_email ) {
1415
  $coupon_code = 'DUMMY-COUPON';
1416
- $checkout_url = $checkout_url . base64_encode( 'dummy-token-string' );
1417
  } else {
1418
  $email_instance = Cartflows_Ca_Email_Templates::get_instance();
1419
  $override_global_coupon = $email_instance->get_email_template_meta_by_key( $email_data->email_template_id, 'override_global_coupon' );
@@ -1431,6 +1443,8 @@ class Cartflows_Ca_Cart_Abandonment {
1431
  $body_email_preview = str_replace( '{{cart.abandoned_date}}', $current_time_stamp, $body_email_preview );
1432
  $unsubscribe_element = '<a target="_blank" style="color: lightgray" href="' . $checkout_url . '&unsubscribe=true' . '">' . __( 'Unsubscribe', 'cartflows-ca' ) . '</a>';
1433
  $body_email_preview = str_replace( '{{cart.unsubscribe}}', $unsubscribe_element, $body_email_preview );
 
 
1434
  $body_email_preview = str_replace( '{{cart.checkout_url}}', $checkout_url, $body_email_preview );
1435
  $host = parse_url( get_site_url() );
1436
  $body_email_preview = str_replace( '{{site.url}}', $host['host'], $body_email_preview );
284
  $woocommerce->cart->empty_cart();
285
  wc_clear_notices();
286
  foreach ( $cart_content as $cart_item ) {
287
+
288
+ // Skip bundled products when added main product.
289
+ if ( isset( $cart_item['bundled_by'] ) ) {
290
+ continue;
291
+ }
292
+
293
  $id = $cart_item['product_id'];
294
  $qty = $cart_item['quantity'];
295
 
465
  $trigger_details = array();
466
  $url = get_option( 'wcf_ca_zapier_cart_abandoned_webhook' );
467
 
468
+ $other_details = unserialize( $checkout_details->other_fields );
469
+ $trigger_details['first_name'] = $other_details['wcf_first_name'];
470
+ $trigger_details['last_name'] = $other_details['wcf_last_name'];
471
+ $trigger_details['phone_number'] = $other_details['wcf_phone_number'];
472
+ $trigger_details['billing_address'] = $other_details['wcf_billing_company'] . ' ' . $other_details['wcf_billing_address_1'] . ', ' . $other_details['wcf_billing_state'] . ', ' . $other_details['wcf_location'] . ', ' . $other_details['wcf_billing_postcode'];
473
+ $trigger_details['billing_address'] = trim( $trigger_details['billing_address'], ', ' );
474
+ $trigger_details['shipping_address'] = $other_details['wcf_shipping_company'] . ' ' . $other_details['wcf_shipping_address_1'] . ', ' . $other_details['wcf_shipping_city'] . ', ' . $other_details['wcf_shipping_state'] . ', ' . $other_details['wcf_shipping_postcode'];
475
+ $trigger_details['shipping_address'] = trim( $trigger_details['shipping_address'], ', ' );
476
+ $trigger_details['email'] = $checkout_details->email;
477
+ $trigger_details['checkout_url'] = $this->get_checkout_url( $checkout_details->checkout_id, $checkout_details->session_id );
478
+ $trigger_details['product_names'] = $this->get_comma_separated_products( $checkout_details->cart_contents );
479
+ $trigger_details['coupon_code'] = $checkout_details->coupon_code;
480
+ $trigger_details['order_status'] = $order_status;
481
+ $trigger_details['cart_total'] = $checkout_details->cart_total;
482
 
483
  $parameters = http_build_query( $trigger_details );
484
  $args = array(
1403
  if ( filter_var( $email_data->email, FILTER_VALIDATE_EMAIL ) ) {
1404
 
1405
  $checkout_url = $this->get_checkout_url( $email_data->checkout_id, $email_data->session_id );
1406
+
1407
  $other_fields = unserialize( $email_data->other_fields );
1408
 
1409
  $from_email_name = get_option( 'wcf_ca_from_name' );
1425
 
1426
  if ( $preview_email ) {
1427
  $coupon_code = 'DUMMY-COUPON';
1428
+ $checkout_url = esc_url( $checkout_url . base64_encode( 'dummy-token-string' ) );
1429
  } else {
1430
  $email_instance = Cartflows_Ca_Email_Templates::get_instance();
1431
  $override_global_coupon = $email_instance->get_email_template_meta_by_key( $email_data->email_template_id, 'override_global_coupon' );
1443
  $body_email_preview = str_replace( '{{cart.abandoned_date}}', $current_time_stamp, $body_email_preview );
1444
  $unsubscribe_element = '<a target="_blank" style="color: lightgray" href="' . $checkout_url . '&unsubscribe=true' . '">' . __( 'Unsubscribe', 'cartflows-ca' ) . '</a>';
1445
  $body_email_preview = str_replace( '{{cart.unsubscribe}}', $unsubscribe_element, $body_email_preview );
1446
+ $body_email_preview = str_replace( 'http://{{cart.checkout_url}}', '{{cart.checkout_url}}', $body_email_preview );
1447
+ $body_email_preview = str_replace( 'https://{{cart.checkout_url}}', '{{cart.checkout_url}}', $body_email_preview );
1448
  $body_email_preview = str_replace( '{{cart.checkout_url}}', $checkout_url, $body_email_preview );
1449
  $host = parse_url( get_site_url() );
1450
  $body_email_preview = str_replace( '{{site.url}}', $host['host'], $body_email_preview );
modules/cart-abandonment/class-cartflows-ca-email-templates.php CHANGED
@@ -71,7 +71,6 @@ class Cartflows_Ca_Email_Templates {
71
  $this->email_history_table = $wpdb->prefix . CARTFLOWS_CA_EMAIL_HISTORY_TABLE;
72
  $this->wpdb = $wpdb;
73
 
74
- $this->fetch_all_active_templates();
75
  add_action( 'admin_enqueue_scripts', __class__ . '::load_email_templates_script', 15 );
76
  }
77
 
71
  $this->email_history_table = $wpdb->prefix . CARTFLOWS_CA_EMAIL_HISTORY_TABLE;
72
  $this->wpdb = $wpdb;
73
 
 
74
  add_action( 'admin_enqueue_scripts', __class__ . '::load_email_templates_script', 15 );
75
  }
76
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.5
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -122,6 +122,11 @@ Yes, the webhook feature will help you with this. You just need to create a webh
122
  4. General settings for Email, Webhook (Coupon Code), GDPR
123
 
124
  == Changelog ==
 
 
 
 
 
125
  = Version 1.1.5 - Tuesday, 9th July 2019
126
  * Fix: Other crons disappearing issue.
127
 
@@ -152,4 +157,4 @@ Yes, the webhook feature will help you with this. You just need to create a webh
152
  = Version 1.0.0 - Monday, 27th May 2019 =
153
  * Initial Release
154
 
155
- == Upgrade Notice ==
4
  Tags: woocommerce, cart abandonment, cart recovery
5
  Requires at least: 4.4
6
  Tested up to: 5.2
7
+ Stable tag: 1.1.6
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
122
  4. General settings for Email, Webhook (Coupon Code), GDPR
123
 
124
  == Changelog ==
125
+ = Version 1.1.6 - Friday, 19th July 2019
126
+ * New: Bundled product support for email checkout URL.
127
+ * Improvement: Added phone number and address while triggering the to webhook.
128
+ * Fix: Creating tables and default settings on activation.
129
+
130
  = Version 1.1.5 - Tuesday, 9th July 2019
131
  * Fix: Other crons disappearing issue.
132
 
157
  = Version 1.0.0 - Monday, 27th May 2019 =
158
  * Initial Release
159
 
160
+ == Upgrade Notice ==
woo-cart-abandonment-recovery.php CHANGED
@@ -3,7 +3,7 @@
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.5
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows-ca
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.6
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows-ca