Discount Rules for WooCommerce - Version 1.9.1

Version Description

  • 24/12/19 =
  • Fix - Wrong discount calculation for the Cart free product discount.
Download this release

Release Info

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

Code changes from version 1.9.0 to 1.9.1

Files changed (3) hide show
  1. includes/cart-rules.php +2 -0
  2. readme.txt +4 -1
  3. woo-discount-rules.php +1 -1
includes/cart-rules.php CHANGED
@@ -2299,6 +2299,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
2299
  }
2300
  $discounted_price = ($discount_quantity * $added_products[$discounted_product_id]['item_price']);
2301
  $coupon_msg = self::formatBOGOCouponCode($added_products[$discounted_product_id]['item_name'], $discount_quantity, $added_products[$discounted_product_id]['product'], $rule_text);
 
2302
  $this->bogo_coupon_codes[$coupon_msg] = array('product_id' => $discounted_product_id, 'amount' => $discounted_price);
2303
  } else {
2304
  //If product not in cart,then add to cart
@@ -2319,6 +2320,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
2319
  do_action('woo_discount_rules_cart_rules_after_adding_free_product_to_cart');
2320
  $discounted_price = ($discount_quantity * FlycartWoocommerceProduct::get_price($product, true));
2321
  $coupon_msg = self::formatBOGOCouponCode(FlycartWoocommerceProduct::get_name($product), $discount_quantity, $product, $rule_text);
 
2322
  $this->bogo_coupon_codes[$coupon_msg] = array('product_id' => $discounted_product_id, 'amount' => $discounted_price);
2323
  }
2324
  }
2299
  }
2300
  $discounted_price = ($discount_quantity * $added_products[$discounted_product_id]['item_price']);
2301
  $coupon_msg = self::formatBOGOCouponCode($added_products[$discounted_product_id]['item_name'], $discount_quantity, $added_products[$discounted_product_id]['product'], $rule_text);
2302
+ $discounted_price = $discounted_price/$added_products[$discounted_product_id]['item_quantity'];
2303
  $this->bogo_coupon_codes[$coupon_msg] = array('product_id' => $discounted_product_id, 'amount' => $discounted_price);
2304
  } else {
2305
  //If product not in cart,then add to cart
2320
  do_action('woo_discount_rules_cart_rules_after_adding_free_product_to_cart');
2321
  $discounted_price = ($discount_quantity * FlycartWoocommerceProduct::get_price($product, true));
2322
  $coupon_msg = self::formatBOGOCouponCode(FlycartWoocommerceProduct::get_name($product), $discount_quantity, $product, $rule_text);
2323
+ $discounted_price = $discounted_price/$added_products[$discounted_product_id]['item_quantity'];
2324
  $this->bogo_coupon_codes[$coupon_msg] = array('product_id' => $discounted_product_id, 'amount' => $discounted_price);
2325
  }
2326
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flycart.org/
4
  Tags: woocommerce, coupons, discounts, dynamic pricing, Buy One Get One Free, pricing deals, bulk discount, discount
5
  Requires at least: 4.4.1
6
  Tested up to: 5.3
7
- Stable tag: 1.9.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -336,6 +336,9 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
336
 
337
  == Changelog ==
338
 
 
 
 
339
  = 1.9.0 - 17/12/19 =
340
  * Improvement - Moved BOGO options to adjustment type for user friendly.
341
  * Improvement - Display time Hours in 24 hours.
4
  Tags: woocommerce, coupons, discounts, dynamic pricing, Buy One Get One Free, pricing deals, bulk discount, discount
5
  Requires at least: 4.4.1
6
  Tested up to: 5.3
7
+ Stable tag: 1.9.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
336
 
337
  == Changelog ==
338
 
339
+ = 1.9.1 - 24/12/19 =
340
+ * Fix - Wrong discount calculation for the Cart free product discount.
341
+
342
  = 1.9.0 - 17/12/19 =
343
  * Improvement - Moved BOGO options to adjustment type for user friendly.
344
  * Improvement - Display time Hours in 24 hours.
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.9.0
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.9.1
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/