WooCommerce Cart Abandonment Recovery - Version 1.2.2

Version Description

Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.2

changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  Version 1.2.1 - Tuesday, 5th November 2019
2
  - New: Added delete option for used & expired coupons which will be created now onwards.
3
  - Fix: Sometimes order status remains "abandoned" for initially failed orders.
1
+ Version 1.2.2 - Tuesday, 12th November 2019
2
+ - Fix: Duplicate order issue for variation products.
3
+
4
  Version 1.2.1 - Tuesday, 5th November 2019
5
  - New: Added delete option for used & expired coupons which will be created now onwards.
6
  - Fix: Sometimes order status remains "abandoned" for initially failed orders.
classes/class-cartflows-ca-loader.php CHANGED
@@ -78,7 +78,7 @@ if ( ! class_exists( 'CARTFLOWS_CA_Loader' ) ) {
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.1' );
82
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
83
 
84
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
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.2' );
82
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
83
 
84
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php CHANGED
@@ -488,10 +488,14 @@ class Cartflows_Ca_Cart_Abandonment {
488
  function check_if_already_purchased_by_email_product_ids( $email_data, $current_cart_data ) {
489
 
490
  global $wpdb;
491
- $current_cart_data = unserialize( $current_cart_data );
492
- $current_products = array_values( wp_list_pluck( $current_cart_data, 'product_id' ) );
 
 
 
 
 
493
  $cart_abandonment_table = $wpdb->prefix . CARTFLOWS_CA_CART_ABANDONMENT_TABLE;
494
- $email_history_table = $wpdb->prefix . CARTFLOWS_CA_EMAIL_HISTORY_TABLE;
495
 
496
  $orders = wc_get_orders(
497
  array(
@@ -515,7 +519,10 @@ class Cartflows_Ca_Cart_Abandonment {
515
 
516
  if ( in_array( $product_id, $current_products, true ) ) {
517
 
518
- $this->skip_future_emails_when_order_is_completed( $email_data->session_id, true );
 
 
 
519
  $need_to_send_email = false;
520
  break;
521
  }
488
  function check_if_already_purchased_by_email_product_ids( $email_data, $current_cart_data ) {
489
 
490
  global $wpdb;
491
+ $current_cart_data = unserialize( $current_cart_data );
492
+
493
+ // Fetch products & variations.
494
+ $products = array_values( wp_list_pluck( $current_cart_data, 'product_id' ) );
495
+ $variations = array_values( wp_list_pluck( $current_cart_data, 'variation_id' ) );
496
+ $current_products = array_unique( array_merge( $products, $variations ) );
497
+
498
  $cart_abandonment_table = $wpdb->prefix . CARTFLOWS_CA_CART_ABANDONMENT_TABLE;
 
499
 
500
  $orders = wc_get_orders(
501
  array(
519
 
520
  if ( in_array( $product_id, $current_products, true ) ) {
521
 
522
+ /**
523
+ * Remove duplicate captured order for tracking.
524
+ */
525
+ $wpdb->delete( $cart_abandonment_table, array( 'session_id' => sanitize_key( $email_data->session_id ) ) );
526
  $need_to_send_email = false;
527
  break;
528
  }
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.2.1
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,9 @@ 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.2.1 - Tuesday, 5th November 2019 =
132
  * New: Added delete option for used & expired coupons which will be created now onwards.
133
  * Fix: Sometimes order status remains "abandoned" for initially failed orders.
@@ -196,4 +199,4 @@ Here are few thoughts behind making it available for free:
196
  = Version 1.0.0 - Monday, 27th May 2019 =
197
  * Initial Release
198
 
199
- == 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.2.2
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.2 - Tuesday, 12th November 2019 =
132
+ * Fix: Duplicate order issue for variation products.
133
+
134
  = Version 1.2.1 - Tuesday, 5th November 2019 =
135
  * New: Added delete option for used & expired coupons which will be created now onwards.
136
  * Fix: Sometimes order status remains "abandoned" for initially failed orders.
199
  = Version 1.0.0 - Monday, 27th May 2019 =
200
  * Initial Release
201
 
202
+ == 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.2.1
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery
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.2
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery