Version Description
- (11 Sep 2013) Bugfix release.
Download this release
Release Info
Developer | Rene Puchinger |
Plugin | WooCommerce Bulk Discount |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- readme.txt +7 -1
- woocommerce-bulk-discount.php +9 -2
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.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -129,6 +129,9 @@ Setting bulk discounts couldn't have been easier.
|
|
129 |
|
130 |
== Changelog ==
|
131 |
|
|
|
|
|
|
|
132 |
= 2.0.2 =
|
133 |
* (5 Sep 2013) Important maintenance release. Now the bulk discount metadata are stored to orders as well, making it possible to correctly display discounts for past orders. One can also change the plugin settings any time.
|
134 |
* Added quick link to settings on Wordpress > Plugins page.
|
@@ -174,6 +177,9 @@ Setting bulk discounts couldn't have been easier.
|
|
174 |
|
175 |
== Upgrade Notice ==
|
176 |
|
|
|
|
|
|
|
177 |
= 2.0.2 =
|
178 |
Important maintenance release. Please update immediately.
|
179 |
|
4 |
Tags: woocommerce, bulk, discount
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 3.6
|
7 |
+
Stable tag: 2.0.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
129 |
|
130 |
== Changelog ==
|
131 |
|
132 |
+
= 2.0.3 =
|
133 |
+
* (11 Sep 2013) Bugfix release.
|
134 |
+
|
135 |
= 2.0.2 =
|
136 |
* (5 Sep 2013) Important maintenance release. Now the bulk discount metadata are stored to orders as well, making it possible to correctly display discounts for past orders. One can also change the plugin settings any time.
|
137 |
* Added quick link to settings on Wordpress > Plugins page.
|
177 |
|
178 |
== Upgrade Notice ==
|
179 |
|
180 |
+
= 2.0.3 =
|
181 |
+
Bugfix release. Please update immediately.
|
182 |
+
|
183 |
= 2.0.2 =
|
184 |
Important maintenance release. Please update immediately.
|
185 |
|
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.
|
8 |
Author URI: http://www.renepuchinger.com
|
9 |
License: GPL3
|
10 |
|
@@ -233,6 +233,9 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
|
|
233 |
global $woocommerce;
|
234 |
$_product = get_product($values['product_id']);
|
235 |
$discount_coeffs = $this->gather_discount_coeffs_from_order($order->id);
|
|
|
|
|
|
|
236 |
$coeff = $discount_coeffs[$this->get_actual_id($_product)]['coeff'];
|
237 |
$discount_type = get_post_meta($order->id, '_woocommerce_t4m_discount_type', true);
|
238 |
if (( $discount_type == 'flat' && $coeff == 0 ) || ($discount_type == '' && $coeff == 1.0 ) ) {
|
@@ -255,7 +258,11 @@ if (!class_exists('Woo_Bulk_Discount_Plugin_t4m')) {
|
|
255 |
*/
|
256 |
protected function gather_discount_coeffs_from_order($order_id)
|
257 |
{
|
258 |
-
$
|
|
|
|
|
|
|
|
|
259 |
return $order_discount_coeffs;
|
260 |
}
|
261 |
|
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.3
|
8 |
Author URI: http://www.renepuchinger.com
|
9 |
License: GPL3
|
10 |
|
233 |
global $woocommerce;
|
234 |
$_product = get_product($values['product_id']);
|
235 |
$discount_coeffs = $this->gather_discount_coeffs_from_order($order->id);
|
236 |
+
if (!$discount_coeffs) {
|
237 |
+
return $price;
|
238 |
+
}
|
239 |
$coeff = $discount_coeffs[$this->get_actual_id($_product)]['coeff'];
|
240 |
$discount_type = get_post_meta($order->id, '_woocommerce_t4m_discount_type', true);
|
241 |
if (( $discount_type == 'flat' && $coeff == 0 ) || ($discount_type == '' && $coeff == 1.0 ) ) {
|
258 |
*/
|
259 |
protected function gather_discount_coeffs_from_order($order_id)
|
260 |
{
|
261 |
+
$meta = get_post_meta($order_id, '_woocommerce_t4m_discount_coeffs', true);
|
262 |
+
if (!$meta) {
|
263 |
+
return null;
|
264 |
+
}
|
265 |
+
$order_discount_coeffs = json_decode($meta, true);
|
266 |
return $order_discount_coeffs;
|
267 |
}
|
268 |
|