Version Description
- Minor change to make the plugin compatible with WooCommerce 2.3.1
- Loop through coupons in ascending order
Download this release
Release Info
Developer | josk79 |
Plugin | WooCommerce Extended Coupon Features |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- assets/Thumbs.db +0 -0
- readme.txt +5 -1
- woocommerce-jos-autocoupon.php +7 -5
assets/Thumbs.db
DELETED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
|
|
4 |
Tags: woocommerce, coupons, discount
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -70,6 +70,10 @@ Sure! [This](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
|
|
70 |
|
71 |
== Changelog ==
|
72 |
|
|
|
|
|
|
|
|
|
73 |
= 1.1.1 =
|
74 |
* Tested with Wordpress 4.0
|
75 |
|
4 |
Tags: woocommerce, coupons, discount
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.1.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
70 |
|
71 |
== Changelog ==
|
72 |
|
73 |
+
= 1.1.2 =
|
74 |
+
* Minor change to make the plugin compatible with WooCommerce 2.3.1
|
75 |
+
* Loop through coupons in ascending order
|
76 |
+
|
77 |
= 1.1.1 =
|
78 |
* Tested with Wordpress 4.0
|
79 |
|
woocommerce-jos-autocoupon.php
CHANGED
@@ -3,13 +3,16 @@
|
|
3 |
* Plugin Name: WooCommerce auto added coupons
|
4 |
* Plugin URI: http://wordpress.org/plugins/woocommerce-auto-added-coupons
|
5 |
* Description: Allow discounts to be automatically added to the cart when it's restrictions are met. Allow applying coupons via an url.
|
6 |
-
* Version: 1.1.
|
7 |
* Author: Jos Koenis
|
8 |
* License: GPL2
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
Change history:
|
|
|
|
|
|
|
13 |
1.1.1:
|
14 |
- Tested with Wordpress 4.0
|
15 |
1.1.0:
|
@@ -124,7 +127,7 @@ class WC_Jos_AutoCoupon_Controller{
|
|
124 |
*/
|
125 |
function update_matched_autocoupons() {
|
126 |
global $woocommerce;
|
127 |
-
|
128 |
foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
|
129 |
if ( ! $woocommerce->cart->has_discount( $coupon_code ) ) {
|
130 |
$coupon = new WC_Coupon($coupon_code);
|
@@ -132,8 +135,6 @@ class WC_Jos_AutoCoupon_Controller{
|
|
132 |
$woocommerce->cart->add_discount( $coupon_code );
|
133 |
$this->overwrite_success_message( $coupon );
|
134 |
}
|
135 |
-
} else {
|
136 |
-
$this->remove_unmatched_autocoupons();
|
137 |
}
|
138 |
}
|
139 |
}
|
@@ -226,13 +227,14 @@ class WC_Jos_AutoCoupon_Controller{
|
|
226 |
'posts_per_page' => -1,
|
227 |
'post_type' => 'shop_coupon',
|
228 |
'post_status' => 'publish',
|
|
|
229 |
);
|
230 |
|
231 |
$query = new WP_Query($query_args);
|
232 |
foreach ($query->posts as $post) {
|
233 |
$coupon = new WC_Coupon($post->post_title);
|
234 |
if ( $this->is_auto_coupon($coupon) ) {
|
235 |
-
$this->_autocoupon_codes[] = $
|
236 |
}
|
237 |
}
|
238 |
}
|
3 |
* Plugin Name: WooCommerce auto added coupons
|
4 |
* Plugin URI: http://wordpress.org/plugins/woocommerce-auto-added-coupons
|
5 |
* Description: Allow discounts to be automatically added to the cart when it's restrictions are met. Allow applying coupons via an url.
|
6 |
+
* Version: 1.1.2
|
7 |
* Author: Jos Koenis
|
8 |
* License: GPL2
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
Change history:
|
13 |
+
1.1.2:
|
14 |
+
- Minor change to make the plugin compatible with WooCommerce 2.3.1
|
15 |
+
- Loop through coupons in ascending order
|
16 |
1.1.1:
|
17 |
- Tested with Wordpress 4.0
|
18 |
1.1.0:
|
127 |
*/
|
128 |
function update_matched_autocoupons() {
|
129 |
global $woocommerce;
|
130 |
+
$this->remove_unmatched_autocoupons();
|
131 |
foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
|
132 |
if ( ! $woocommerce->cart->has_discount( $coupon_code ) ) {
|
133 |
$coupon = new WC_Coupon($coupon_code);
|
135 |
$woocommerce->cart->add_discount( $coupon_code );
|
136 |
$this->overwrite_success_message( $coupon );
|
137 |
}
|
|
|
|
|
138 |
}
|
139 |
}
|
140 |
}
|
227 |
'posts_per_page' => -1,
|
228 |
'post_type' => 'shop_coupon',
|
229 |
'post_status' => 'publish',
|
230 |
+
'orderby' => 'title'
|
231 |
);
|
232 |
|
233 |
$query = new WP_Query($query_args);
|
234 |
foreach ($query->posts as $post) {
|
235 |
$coupon = new WC_Coupon($post->post_title);
|
236 |
if ( $this->is_auto_coupon($coupon) ) {
|
237 |
+
$this->_autocoupon_codes[] = $post->post_title;
|
238 |
}
|
239 |
}
|
240 |
}
|