WooCommerce Bulk Discount - Version 2.3.2

Version Description

  • (4 Feb 2016) Bugfix - the discount was not applied when the user created an account during checkout.
Download this release

Release Info

Developer Rene Puchinger
Plugin Icon 128x128 WooCommerce Bulk Discount
Version 2.3.2
Comparing to
See all releases

Code changes from version 2.3.1 to 2.3.2

Files changed (2) hide show
  1. readme.txt +8 -2
  2. woocommerce-bulk-discount.php +6 -1
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Rene Puchinger
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6VEQ8XXK6B3UE
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.6
6
- Tested up to: 4.4.1
7
- Stable tag: 2.3.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -146,6 +146,9 @@ Setting bulk discounts couldn't have been easier.
146
 
147
  == Changelog ==
148
 
 
 
 
149
  = 2.3.1 =
150
  * (28 Sep 2014) Bugfix - settings tab was not working in WooCommerce 2.0.x
151
 
@@ -260,6 +263,9 @@ Setting bulk discounts couldn't have been easier.
260
 
261
  == Upgrade Notice ==
262
 
 
 
 
263
  = 2.3.1 =
264
  Bugfix release.
265
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6VEQ8XXK6B3UE
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.6
6
+ Tested up to: 4.4.2
7
+ Stable tag: 2.3.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
146
 
147
  == Changelog ==
148
 
149
+ = 2.3.2 =
150
+ * (4 Feb 2016) Bugfix - the discount was not applied when the user created an account during checkout.
151
+
152
  = 2.3.1 =
153
  * (28 Sep 2014) Bugfix - settings tab was not working in WooCommerce 2.0.x
154
 
263
 
264
  == Upgrade Notice ==
265
 
266
+ = 2.3.2 =
267
+ Bugfix release.
268
+
269
  = 2.3.1 =
270
  Bugfix release.
271
 
woocommerce-bulk-discount.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WooCommerce Bulk Discount
4
  Plugin URI: http://wordpress.org/plugins/woocommerce-bulk-discount/
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
- Version: 2.3.1
8
  Author URI: https://profiles.wordpress.org/rene-puchinger/
9
  License: GPL3
10
 
@@ -440,6 +440,10 @@ if ( !class_exists( 'Woo_Bulk_Discount_Plugin_t4m' ) ) {
440
  return;
441
  }
442
 
 
 
 
 
443
  if ( sizeof( $cart->cart_contents ) > 0 ) {
444
  foreach ( $cart->cart_contents as $cart_item_key => $values ) {
445
  $_product = $values['data'];
@@ -448,6 +452,7 @@ if ( !class_exists( 'Woo_Bulk_Discount_Plugin_t4m' ) ) {
448
  }
449
  $values['data']->set_price( $this->discount_coeffs[$this->get_actual_id( $_product )]['orig_price'] );
450
  }
 
451
  }
452
 
453
  }
4
  Plugin URI: http://wordpress.org/plugins/woocommerce-bulk-discount/
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
+ Version: 2.3.2
8
  Author URI: https://profiles.wordpress.org/rene-puchinger/
9
  License: GPL3
10
 
440
  return;
441
  }
442
 
443
+ if ( !$this->bulk_discount_calculated) {
444
+ return;
445
+ }
446
+
447
  if ( sizeof( $cart->cart_contents ) > 0 ) {
448
  foreach ( $cart->cart_contents as $cart_item_key => $values ) {
449
  $_product = $values['data'];
452
  }
453
  $values['data']->set_price( $this->discount_coeffs[$this->get_actual_id( $_product )]['orig_price'] );
454
  }
455
+ $this->bulk_discount_calculated = false;
456
  }
457
 
458
  }