WooCommerce Extended Coupon Features - Version 2.2.5.1

Version Description

  • FIX: When checkbox 'Individual use' was ticked, Autocoupons would be removed/added multiple times
Download this release

Release Info

Developer josk79
Plugin Icon 128x128 WooCommerce Extended Coupon Features
Version 2.2.5.1
Comparing to
See all releases

Code changes from version 2.2.5 to 2.2.5.1

includes/wjecf-autocoupon.php CHANGED
@@ -227,12 +227,17 @@ class WC_Jos_AutoCoupon_Controller {
227
  //echo "</pre>";
228
  }
229
  //Test individual use
230
- elseif ( $coupon->individual_use == 'yes' && count( WC()->cart->applied_coupons ) != 0 ) {
231
- $can_be_applied = false;
 
 
 
 
232
  }
 
233
  //Test restricted emails
234
  //See WooCommerce: class-wc-cart.php function check_customer_coupons
235
- elseif ( is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
236
  $user_emails = array_map( 'sanitize_email', array_map( 'strtolower', $this->get_user_emails() ) );
237
  $coupon_emails = array_map( 'sanitize_email', array_map( 'strtolower', $coupon->customer_email ) );
238
 
227
  //echo "</pre>";
228
  }
229
  //Test individual use
230
+ elseif ( $coupon->individual_use == 'yes' ) {
231
+ if ( count( WC()->cart->applied_coupons ) > 1 ) {
232
+ $can_be_applied = false;
233
+ } elseif ( count( WC()->cart->applied_coupons ) == 1 && ! in_array( $coupon->code, WC()->cart->applied_coupons ) ) {
234
+ $can_be_applied = false;
235
+ }
236
  }
237
+
238
  //Test restricted emails
239
  //See WooCommerce: class-wc-cart.php function check_customer_coupons
240
+ if ( $can_be_applied && is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
241
  $user_emails = array_map( 'sanitize_email', array_map( 'strtolower', $this->get_user_emails() ) );
242
  $coupon_emails = array_map( 'sanitize_email', array_map( 'strtolower', $coupon->customer_email ) );
243
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
4
  Tags: woocommerce, coupons, discount
5
  Requires at least: 4.0.0
6
  Tested up to: 4.3.1
7
- Stable tag: 2.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -100,11 +100,14 @@ Sure! [This](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
100
  4. Additionals restrictions based on shipping or payment method or the customer
101
 
102
  == Changelog ==
 
 
 
103
  = 2.2.5 =
104
- * FEATURE: BOGO On all matching products
105
  * FIX: Changed WooCommerce detection method for better Multi Site support
106
- * FIX: Free products: Fixed an inconsistency that could cause a loop on removal/adding of free variant products
107
- * TWEAK: Free products: Hooking before_calculate_totals for most cases but also on woocommerce_applied_coupon, which is required when one coupon is replaced by another
108
  * INTERNAL: Check if classes already exist before creating them
109
 
110
  = 2.2.4 =
4
  Tags: woocommerce, coupons, discount
5
  Requires at least: 4.0.0
6
  Tested up to: 4.3.1
7
+ Stable tag: 2.2.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
100
  4. Additionals restrictions based on shipping or payment method or the customer
101
 
102
  == Changelog ==
103
+ = 2.2.5.1 =
104
+ * FIX: When checkbox 'Individual use' was ticked, Autocoupons would be removed/added multiple times
105
+
106
  = 2.2.5 =
107
+ * (PRO) FEATURE: BOGO On all matching products
108
  * FIX: Changed WooCommerce detection method for better Multi Site support
109
+ * (PRO) FIX: Free products: Fixed an inconsistency that could cause a loop on removal/adding of free variant products
110
+ * (PRO) TWEAK: Free products: Hooking before_calculate_totals for most cases but also on woocommerce_applied_coupon, which is required when one coupon is replaced by another
111
  * INTERNAL: Check if classes already exist before creating them
112
 
113
  = 2.2.4 =
woocommerce-jos-autocoupon.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Extended Coupon Features
4
  * Plugin URI: http://www.soft79.nl
5
  * Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
6
- * Version: 2.2.5
7
  * Author: Jos Koenis
8
  * License: GPL2
9
  */
3
  * Plugin Name: WooCommerce Extended Coupon Features
4
  * Plugin URI: http://www.soft79.nl
5
  * Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
6
+ * Version: 2.2.5.1
7
  * Author: Jos Koenis
8
  * License: GPL2
9
  */