WooCommerce Bulk Discount - Version 2.0.10

Version Description

  • (10 Oct 2013) Fixing a bug which might have resulted in collision with few other WooCommerce plugins.
Download this release

Release Info

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

Code changes from version 2.0.9 to 2.0.10

Files changed (2) hide show
  1. readme.txt +7 -1
  2. woocommerce-bulk-discount.php +13 -1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_butt
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
- Stable tag: 2.0.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -135,6 +135,9 @@ Setting bulk discounts couldn't have been easier.
135
 
136
  == Changelog ==
137
 
 
 
 
138
  = 2.0.9 =
139
  * (9 Oct 2013) Translations updated.
140
  * Minor code formatting changes.
@@ -203,6 +206,9 @@ Setting bulk discounts couldn't have been easier.
203
 
204
  == Upgrade Notice ==
205
 
 
 
 
206
  = 2.0.9 =
207
  Maintenance release.
208
 
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
+ Stable tag: 2.0.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
135
 
136
  == Changelog ==
137
 
138
+ = 2.0.10 =
139
+ * (10 Oct 2013) Fixing a bug which might have resulted in collision with few other WooCommerce plugins.
140
+
141
  = 2.0.9 =
142
  * (9 Oct 2013) Translations updated.
143
  * Minor code formatting changes.
206
 
207
  == Upgrade Notice ==
208
 
209
+ = 2.0.10 =
210
+ Bugfix release.
211
+
212
  = 2.0.9 =
213
  Maintenance release.
214
 
woocommerce-bulk-discount.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WooCommerce Bulk Discount
4
  Plugin URI: http://www.tools4me.net/wordpress/woocommerce-bulk-discount-plugin
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
- Version: 2.0.9
8
  Author URI: http://www.renepuchinger.com
9
  License: GPL3
10
 
@@ -136,6 +136,9 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
136
  */
137
  public function filter_item_price($price, $values) {
138
  global $woocommerce;
 
 
 
139
  if ((get_option('woocommerce_t4m_show_on_item', 'yes') == 'no')) {
140
  return $price;
141
  }
@@ -170,6 +173,9 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
170
  */
171
  public function filter_subtotal_price($price, $values) {
172
  global $woocommerce;
 
 
 
173
  if ((get_option('woocommerce_t4m_show_on_subtotal', 'yes') == 'no')) {
174
  return $price;
175
  }
@@ -230,6 +236,9 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
230
  */
231
  public function filter_subtotal_order_price($price, $values, $order) {
232
  global $woocommerce;
 
 
 
233
  if ((get_option('woocommerce_t4m_show_on_order_subtotal', 'yes') == 'no')) {
234
  return $price;
235
  }
@@ -335,6 +344,9 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
335
  * @return string
336
  */
337
  public function filter_cart_product_subtotal($subtotal, $_product, $quantity) {
 
 
 
338
  $coeff = $this->discount_coeffs[$this->get_actual_id($_product)]['coeff'];
339
  if ((get_option('woocommerce_t4m_discount_type', '') == 'flat')) {
340
  $newsubtotal = woocommerce_price(max(0, ($_product->get_price() * $quantity) - $coeff));
4
  Plugin URI: http://www.tools4me.net/wordpress/woocommerce-bulk-discount-plugin
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
+ Version: 2.0.10
8
  Author URI: http://www.renepuchinger.com
9
  License: GPL3
10
 
136
  */
137
  public function filter_item_price($price, $values) {
138
  global $woocommerce;
139
+ if (!$values || @!$values['data']) {
140
+ return $price;
141
+ }
142
  if ((get_option('woocommerce_t4m_show_on_item', 'yes') == 'no')) {
143
  return $price;
144
  }
173
  */
174
  public function filter_subtotal_price($price, $values) {
175
  global $woocommerce;
176
+ if (!$values || !$values['data']) {
177
+ return $price;
178
+ }
179
  if ((get_option('woocommerce_t4m_show_on_subtotal', 'yes') == 'no')) {
180
  return $price;
181
  }
236
  */
237
  public function filter_subtotal_order_price($price, $values, $order) {
238
  global $woocommerce;
239
+ if (!$values || !$order) {
240
+ return $price;
241
+ }
242
  if ((get_option('woocommerce_t4m_show_on_order_subtotal', 'yes') == 'no')) {
243
  return $price;
244
  }
344
  * @return string
345
  */
346
  public function filter_cart_product_subtotal($subtotal, $_product, $quantity) {
347
+ if (!$_product || !$quantity) {
348
+ return $subtotal;
349
+ }
350
  $coeff = $this->discount_coeffs[$this->get_actual_id($_product)]['coeff'];
351
  if ((get_option('woocommerce_t4m_discount_type', '') == 'flat')) {
352
  $newsubtotal = woocommerce_price(max(0, ($_product->get_price() * $quantity) - $coeff));