Discount Rules for WooCommerce - Version 1.4.42

Version Description

  • 06/02/18 =
  • Fix - Coupon discount not applied for WooCommerce older v3.2
Download this release

Release Info

Developer flycart
Plugin Icon 128x128 Discount Rules for WooCommerce
Version 1.4.42
Comparing to
See all releases

Code changes from version 1.4.41 to 1.4.42

Files changed (3) hide show
  1. includes/cart-rules.php +12 -5
  2. readme.txt +4 -1
  3. woo-discount-rules.php +1 -1
includes/cart-rules.php CHANGED
@@ -282,14 +282,16 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
282
  $this->makeLog();
283
  $discount_type = 'fixed_cart';
284
  $amount = $this->discount_total;
285
- if(!$this->has_category_in_rule){
286
- $discount_type = 'percent';
287
- //To calculate the percent from total
288
- $amount = ((100 * $this->discount_total) / $this->sub_total);
 
 
289
  }
 
290
  $coupon = array(
291
  'id' => 321123 . rand(2, 9),
292
- 'discount_type' => $discount_type,
293
  'amount' => $amount,
294
  'individual_use' => false,
295
  'product_ids' => array(),
@@ -308,6 +310,11 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
308
  'maximum_amount' => '',
309
  'customer_email' => '',
310
  );
 
 
 
 
 
311
 
312
  return $coupon;
313
  }
282
  $this->makeLog();
283
  $discount_type = 'fixed_cart';
284
  $amount = $this->discount_total;
285
+ if(FlycartWoocommerceVersion::wcVersion('3.2')){
286
+ if(!$this->has_category_in_rule){
287
+ $discount_type = 'percent';
288
+ //To calculate the percent from total
289
+ $amount = ((100 * $this->discount_total) / $this->sub_total);
290
+ }
291
  }
292
+
293
  $coupon = array(
294
  'id' => 321123 . rand(2, 9),
 
295
  'amount' => $amount,
296
  'individual_use' => false,
297
  'product_ids' => array(),
310
  'maximum_amount' => '',
311
  'customer_email' => '',
312
  );
313
+ if(FlycartWoocommerceVersion::wcVersion('3.2')) {
314
+ $coupon['discount_type'] = $discount_type;
315
+ } else {
316
+ $coupon['type'] = $discount_type;
317
+ }
318
 
319
  return $coupon;
320
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
- Stable tag: 1.4.41
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -241,6 +241,9 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
241
 
242
  == Changelog ==
243
 
 
 
 
244
  = 1.4.41 - 30/01/18 =
245
  * Fix - Apply coupon discount in percent if there is no rule based on category for better detail in order
246
  * Feature - Option: More than one cheapest product as free option in BOGO for pro version
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
+ Stable tag: 1.4.42
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
241
 
242
  == Changelog ==
243
 
244
+ = 1.4.42 - 06/02/18 =
245
+ * Fix - Coupon discount not applied for WooCommerce older v3.2
246
+
247
  = 1.4.41 - 30/01/18 =
248
  * Fix - Apply coupon discount in percent if there is no rule based on category for better detail in order
249
  * Feature - Option: More than one cheapest product as free option in BOGO for pro version
woo-discount-rules.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
- * Version: 1.4.41
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Requires at least: 4.6.1
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.4.42
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Requires at least: 4.6.1