WooCommerce Extended Coupon Features - Version 2.2.1

Version Description

  • FIX: Prevent mulitple apply_coupon calls (for example through ajax)
  • FIX: Don't redirect to cart when using WooCommerce's ?add-to-cart=xxx in combination with ?apply_coupon=xxx as this would prevent the application of the coupon.
Download this release

Release Info

Developer josk79
Plugin Icon 128x128 WooCommerce Extended Coupon Features
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.2.1

assets/screenshot-1.png CHANGED
Binary file
includes/wjecf-autocoupon.php CHANGED
@@ -8,6 +8,8 @@ class WC_Jos_AutoCoupon_Controller{
8
 
9
  private $_check_already_performed = false;
10
 
 
 
11
  public function __construct() {
12
  add_action('init', array( &$this, 'controller_init' ));
13
  }
@@ -17,53 +19,100 @@ class WC_Jos_AutoCoupon_Controller{
17
  return;
18
  }
19
 
20
- $this->log( $_SERVER['REQUEST_URI'] );
21
-
22
  //Admin hooks
23
- add_action( 'woocommerce_coupon_options_usage_restriction', array( $this, 'coupon_options' ), 10, 0 );
24
- add_action( 'woocommerce_process_shop_coupon_meta', array( $this, 'process_shop_coupon_meta' ), 10, 2 );
25
 
26
  //Frontend hooks
 
27
  add_action( 'woocommerce_check_cart_items', array( &$this, 'update_matched_autocoupons' ) , 0 ); //Remove coupon before WC does it and shows a message
28
  add_action( 'woocommerce_before_cart_totals', array( &$this, 'update_matched_autocoupons' ) ); //When cart is updated after changing shipping method
29
  add_action( 'woocommerce_review_order_before_cart_contents', array( &$this, 'update_matched_autocoupons' ) ); //When cart is updated after changing shipping or payment method
30
 
 
 
 
31
  add_filter('woocommerce_cart_totals_coupon_label', array( &$this, 'coupon_label' ), 10, 2 );
32
  add_filter('woocommerce_cart_totals_coupon_html', array( &$this, 'coupon_html' ), 10, 2 );
33
-
34
- //Last check for coupons with restricted_emails
35
- //DONT USE: Breaks cart preview update //add_action( 'woocommerce_checkout_update_order_review', array( $this, 'checkout_update_order_review' ), 10 ); // AJAX One page checkout //
36
- add_action( 'woocommerce_after_checkout_validation', array( $this, 'after_checkout_validation' ), 0 ); // After checkout / before payment
37
 
38
- add_action( 'wp_loaded', array( &$this, 'coupon_by_url' )); //Coupon through url
 
 
 
 
 
39
 
40
  }
41
 
42
  /* ADMIN HOOKS */
 
 
 
 
 
 
 
 
 
 
43
 
44
- public function coupon_options() {
45
 
 
46
  // Auto coupon checkbox
47
  woocommerce_wp_checkbox( array(
48
- 'id' => 'woocommerce-jos-autocoupon',
49
  'label' => __( 'Auto coupon', 'woocommerce-jos-autocoupon' ),
50
- 'description' => __( "Automatically add the coupon to the cart if the restrictions are met. Please enter a description when you check this box, the description will be shown in the customers cart if the coupon is applied.", 'woocommerce-jos-autocoupon' )
51
  ) );
52
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
  public function process_shop_coupon_meta( $post_id, $post ) {
56
- $autocoupon = isset( $_POST['woocommerce-jos-autocoupon'] ) ? 'yes' : 'no';
57
- update_post_meta( $post_id, 'woocommerce-jos-autocoupon', $autocoupon );
58
  }
59
 
60
  /* FRONTEND HOOKS */
61
 
 
 
 
 
 
 
 
 
62
  /**
63
  * Add coupon through url
64
  */
65
  public function coupon_by_url() {
66
- if (isset($_GET['apply_coupon'])) {
 
67
  $split = explode( ",", $_GET['apply_coupon'] );
68
 
69
  global $woocommerce;
@@ -122,24 +171,34 @@ class WC_Jos_AutoCoupon_Controller{
122
  * @return void
123
  */
124
  function update_matched_autocoupons() {
125
- $this->log ( 'update_matched_autocoupons' );
126
- if ( $this->_check_already_performed ) return;
 
 
 
127
 
128
  global $woocommerce;
129
- $this->remove_unmatched_autocoupons();
130
  foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
131
  if ( ! $woocommerce->cart->has_discount( $coupon_code ) ) {
132
  $coupon = new WC_Coupon($coupon_code);
133
- if ( $this->coupon_can_be_applied($coupon) ) {
134
- $this->log( sprintf( "Applying %s", $coupon_code ) );
135
  $woocommerce->cart->add_discount( $coupon_code );
136
- $this->overwrite_success_message( $coupon );
 
 
137
  } else {
138
- $this->log( sprintf( "Not applicable: %s", $coupon_code ) );
139
  }
140
  }
141
  }
142
  $this->_check_already_performed = true;
 
 
 
 
 
143
  }
144
 
145
  /**
@@ -149,75 +208,95 @@ class WC_Jos_AutoCoupon_Controller{
149
  function coupon_can_be_applied($coupon) {
150
  global $woocommerce;
151
 
 
 
152
  //Test validity
153
  if ( ! $coupon->is_valid() ) {
154
- return false;
155
  }
156
  //Test individual use
157
- if ( $coupon->individual_use == 'yes' && count( $woocommerce->cart->applied_coupons ) != 0 ) {
158
- return false;
159
  }
160
-
161
  //Test restricted emails
162
  //See WooCommerce: class-wc-cart.php function check_customer_coupons
163
- if ( is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
164
  $user_emails = array_map( 'sanitize_email', array_map( 'strtolower', $this->get_user_emails() ) );
165
  $coupon_emails = array_map( 'sanitize_email', array_map( 'strtolower', $coupon->customer_email ) );
166
 
167
  if ( 0 == sizeof( array_intersect( $user_emails, $coupon_emails ) ) ) {
168
- return false;
169
  }
170
  }
171
 
172
- //===========================================
173
- //Can be applied. Now test if it has a value
 
 
 
 
 
 
 
 
 
 
174
 
175
  if ( $coupon->enable_free_shipping() ) {
176
- return true;
177
- }
178
- //Test whether discount > 0
179
- //See WooCommerce: class-wc-cart.php function get_discounted_price
180
- foreach ( $woocommerce->cart->get_cart() as $cart_item) {
181
- if ( $coupon->is_valid_for_cart() || $coupon->is_valid_for_product( $cart_item['data'], $cart_item ) ) {
182
- if ( $coupon->get_discount_amount( $cart_item['data']->price, $cart_item ) > 0 ) {
183
- return true;
 
 
 
184
  }
185
  }
186
  }
187
 
188
- return false;
 
189
  }
190
 
191
 
192
-
193
-
194
  /**
195
  * Remove unmatched autocoupons. No message will be shown.
196
  * NOTE: This function must be called before WooCommerce removes the coupon, to inhibit WooCommerces "coupon not valid"-message!
197
- * @return void
198
  */
199
  function remove_unmatched_autocoupons() {
200
  global $woocommerce;
201
 
 
202
  foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
203
  if ( $woocommerce->cart->has_discount( $coupon_code ) ) {
204
  $coupon = new WC_Coupon($coupon_code);
205
  if ( ! $this->coupon_can_be_applied($coupon) ) {
206
- $this->log( sprintf( "Removing %s", $coupon_code ) );
207
  WC()->cart->remove_coupon( $coupon_code );
 
208
  }
209
  }
210
  }
 
211
  }
212
 
213
  /**
214
  * Overwrite the default "Coupon added" notice with a more descriptive message.
215
  * @param WC_Coupon $coupon The coupon data
 
216
  * @return void
217
  */
218
- private function overwrite_success_message( $coupon ) {
219
  $succss_msg = $coupon->get_coupon_message( WC_Coupon::WC_COUPON_SUCCESS );
220
 
 
 
 
221
  $new_succss_msg = sprintf(
222
  __("Discount applied: %s", 'woocommerce-jos-autocoupon'),
223
  __($this->coupon_excerpt($coupon), 'woocommerce-jos-autocoupon')
@@ -226,6 +305,9 @@ class WC_Jos_AutoCoupon_Controller{
226
  //Compatibility woocommerce-2-1-notice-api
227
  if ( function_exists('wc_get_notices') ) {
228
  $all_notices = wc_get_notices();
 
 
 
229
  $messages = $all_notices['success'];
230
  } else {
231
  $messages = $woocommerce->messages;
@@ -235,7 +317,7 @@ class WC_Jos_AutoCoupon_Controller{
235
  for( $y=0; $y < $sizeof_messages; $y++ ) {
236
  if ( $messages[$y] == $succss_msg ) {
237
  if ( isset($all_notices) ) {
238
- if (defined('DOING_AJAX') && DOING_AJAX) {
239
  unset ( $all_notices['success'][$y] );
240
  } else {
241
  $all_notices['success'][$y] = $new_succss_msg;
@@ -243,7 +325,7 @@ class WC_Jos_AutoCoupon_Controller{
243
 
244
  WC()->session->set( 'wc_notices', $all_notices );
245
  } else {
246
- if (defined('DOING_AJAX') && DOING_AJAX) {
247
  unset ( $messages[$y] );
248
  } else {
249
  $messages[$y] = $new_succss_msg;
@@ -261,7 +343,7 @@ class WC_Jos_AutoCoupon_Controller{
261
  * @return bool true if it is an "Auto coupon"
262
  */
263
  private function is_auto_coupon($coupon) {
264
- return get_post_meta( $coupon->id, 'woocommerce-jos-autocoupon', true ) == 'yes';
265
  }
266
 
267
 
@@ -287,8 +369,11 @@ class WC_Jos_AutoCoupon_Controller{
287
  $current_user = wp_get_current_user();
288
  $this->_user_emails[] = $current_user->user_email;
289
  }
 
 
 
290
  }
291
- $this->log( "User emails: ", join( ",", $this->_user_emails ) );
292
  return $this->_user_emails;
293
  }
294
 
@@ -302,34 +387,23 @@ class WC_Jos_AutoCoupon_Controller{
302
  if ( ! is_array( $append_emails ) ) {
303
  $append_emails = array( $append_emails );
304
  }
305
-
306
- $this->_user_emails = array_merge( $this->get_user_emails(), $append_emails );
307
  }
308
 
309
- /**
310
- * After checkout validation
311
- * Get billing email for coupon with restricted_emails
312
- * Append matching coupons with restricted emails
313
- * @param $posted array Billing data
314
- * @return void
315
- */
316
- public function after_checkout_validation( $posted ) {
317
- $this->log ( 'update_matched_autocoupons' );
318
- // $this->log ( sprintf( "After checkout: %s", print_r ( $posted, true ) ) );
319
- $this->get_user_emails();
320
  if ( isset ( $posted['billing_email'] ) ) {
321
  $this->append_user_emails( $posted['billing_email'] );
322
  }
323
 
324
- $this->update_matched_autocoupons();
325
- }
326
-
327
- //Same as after_checkout_validation, only post_data is a query=string&like=this that must be converted to an array
328
- public function checkout_update_order_review( $post_data ) {
329
- $posted = array();
330
- parse_str( $post_data, $posted );
331
- $this->after_checkout_validation( $posted );
332
- }
333
 
334
  /**
335
  * Get a list of all auto coupon codes
@@ -337,7 +411,7 @@ class WC_Jos_AutoCoupon_Controller{
337
  */
338
  private function get_all_auto_coupons() {
339
 
340
- if ( !is_array($this->_autocoupon_codes) ) {
341
  $this->_autocoupon_codes = array();
342
 
343
  $query_args = array(
@@ -347,7 +421,7 @@ class WC_Jos_AutoCoupon_Controller{
347
  'orderby' => 'title',
348
  'meta_query' => array(
349
  array(
350
- 'key' => 'woocommerce-jos-autocoupon',
351
  'value' => 'yes',
352
  'compare' => '=',
353
  ),
@@ -365,7 +439,8 @@ class WC_Jos_AutoCoupon_Controller{
365
  return $this->_autocoupon_codes;
366
  }
367
 
 
368
  private function log ( $string ) {
369
- // file_put_contents ( "/lamp/www/logfile.log", current_filter() . ": " . $string . "\n" , FILE_APPEND );
370
  }
371
  }
8
 
9
  private $_check_already_performed = false;
10
 
11
+ protected $_executed_coupon_by_url = false;
12
+
13
  public function __construct() {
14
  add_action('init', array( &$this, 'controller_init' ));
15
  }
19
  return;
20
  }
21
 
 
 
22
  //Admin hooks
23
+ add_action( 'admin_init', array( &$this, 'admin_init' ) );
 
24
 
25
  //Frontend hooks
26
+ //add_action( 'woocommerce_cart_updated', array( &$this, 'update_matched_autocoupons' ) ); //experiment 2.1.0-b1
27
  add_action( 'woocommerce_check_cart_items', array( &$this, 'update_matched_autocoupons' ) , 0 ); //Remove coupon before WC does it and shows a message
28
  add_action( 'woocommerce_before_cart_totals', array( &$this, 'update_matched_autocoupons' ) ); //When cart is updated after changing shipping method
29
  add_action( 'woocommerce_review_order_before_cart_contents', array( &$this, 'update_matched_autocoupons' ) ); //When cart is updated after changing shipping or payment method
30
 
31
+ //Last check for coupons with restricted_emails
32
+ add_action( 'woocommerce_checkout_update_order_review', array( $this, 'fetch_billing_email' ), 10 ); // AJAX One page checkout
33
+
34
  add_filter('woocommerce_cart_totals_coupon_label', array( &$this, 'coupon_label' ), 10, 2 );
35
  add_filter('woocommerce_cart_totals_coupon_html', array( &$this, 'coupon_html' ), 10, 2 );
 
 
 
 
36
 
37
+ //Inhibit redirect to cart when apply_coupon supplied
38
+ add_filter('option_woocommerce_cart_redirect_after_add', array ( &$this, 'option_woocommerce_cart_redirect_after_add') );
39
+
40
+ if ( ! is_ajax() ) {
41
+ add_action( 'wp_loaded', array( &$this, 'coupon_by_url' ), 23); //Coupon through url
42
+ }
43
 
44
  }
45
 
46
  /* ADMIN HOOKS */
47
+ public function admin_init() {
48
+ add_action( 'wjecf_woocommerce_coupon_options_extended_features', array( $this, 'admin_coupon_options_extended_features' ), 20, 0 );
49
+ add_action( 'woocommerce_process_shop_coupon_meta', array( $this, 'process_shop_coupon_meta' ), 10, 2 );
50
+ }
51
+
52
+ public function admin_coupon_options_extended_features() {
53
+
54
+ //=============================
55
+ //Title
56
+ echo "<h3 style='display:inline'>" . esc_html( __( 'Auto coupon', 'woocommerce-jos-autocoupon' ) ). "</h3>\n";
57
 
 
58
 
59
+ //=============================
60
  // Auto coupon checkbox
61
  woocommerce_wp_checkbox( array(
62
+ 'id' => '_wjecf_is_auto_coupon',
63
  'label' => __( 'Auto coupon', 'woocommerce-jos-autocoupon' ),
64
+ 'description' => __( "Automatically add the coupon to the cart if the restrictions are met. Please enter a description when you check this box, the description will be shown in the customer's cart if the coupon is applied.", 'woocommerce-jos-autocoupon' )
65
  ) );
66
+
67
+ //=============================
68
+ // Apply without notice
69
+ woocommerce_wp_checkbox( array(
70
+ 'id' => '_wjecf_apply_silently',
71
+ 'label' => __( 'Apply silently', 'woocommerce-jos-autocoupon' ),
72
+ 'description' => __( "Don't display a message when this coupon is automatically applied.", 'woocommerce-jos-autocoupon' ),
73
+ ) );
74
+
75
+ ?>
76
+ <script type="text/javascript">
77
+ //Hide/show when AUTO-COUPON value changes
78
+ function update_wjecf_apply_silently_field( animation ) {
79
+ if ( animation === undefined ) animation = 'slow';
80
+
81
+ if (jQuery("#_wjecf_is_auto_coupon").prop('checked')) {
82
+ jQuery("._wjecf_apply_silently_field").show( animation );
83
+ } else {
84
+ jQuery("._wjecf_apply_silently_field").hide( animation );
85
+ }
86
+ }
87
+ update_wjecf_apply_silently_field( 0 );
88
+
89
+ jQuery("#_wjecf_is_auto_coupon").click( update_wjecf_apply_silently_field );
90
+ </script>
91
+ <?php
92
+
93
  }
94
 
95
  public function process_shop_coupon_meta( $post_id, $post ) {
96
+ update_post_meta( $post_id, '_wjecf_is_auto_coupon', isset( $_POST['_wjecf_is_auto_coupon'] ) ? 'yes' : 'no' );
97
+ update_post_meta( $post_id, '_wjecf_apply_silently', isset( $_POST['_wjecf_apply_silently'] ) ? 'yes' : 'no' );
98
  }
99
 
100
  /* FRONTEND HOOKS */
101
 
102
+ //Inhibit redirect to cart when apply_coupon supplied
103
+ public function option_woocommerce_cart_redirect_after_add ( $value ) {
104
+ if ( ! $this->_executed_coupon_by_url && isset( $_GET['apply_coupon'] ) ) {
105
+ $value = 'no';
106
+ }
107
+ return $value;
108
+ }
109
+
110
  /**
111
  * Add coupon through url
112
  */
113
  public function coupon_by_url() {
114
+ if (! $this->_executed_coupon_by_url && isset($_GET['apply_coupon'])) {
115
+ $this->_executed_coupon_by_url = true;
116
  $split = explode( ",", $_GET['apply_coupon'] );
117
 
118
  global $woocommerce;
171
  * @return void
172
  */
173
  function update_matched_autocoupons() {
174
+ //$this->log ( 'update_matched_autocoupons' );
175
+ if ( $this->_check_already_performed ) {
176
+ //$this->log ( 'check already performed' );
177
+ return;
178
+ }
179
 
180
  global $woocommerce;
181
+ $calc_needed = $this->remove_unmatched_autocoupons();
182
  foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
183
  if ( ! $woocommerce->cart->has_discount( $coupon_code ) ) {
184
  $coupon = new WC_Coupon($coupon_code);
185
+ if ( $this->coupon_can_be_applied($coupon) && $this->coupon_has_a_value( $coupon ) ) {
186
+ //$this->log( sprintf( "Applying %s", $coupon_code ) );
187
  $woocommerce->cart->add_discount( $coupon_code );
188
+ $calc_needed = false; //Already done by adding the discount
189
+ $apply_silently = get_post_meta( $coupon->id, '_wjecf_apply_silently', true ) == 'yes';
190
+ $this->overwrite_success_message( $coupon, $apply_silently );
191
  } else {
192
+ //$this->log( sprintf( "Not applicable: %s", $coupon_code ) );
193
  }
194
  }
195
  }
196
  $this->_check_already_performed = true;
197
+
198
+ if ( $calc_needed ) {
199
+ $woocommerce->cart->calculate_totals();
200
+ }
201
+
202
  }
203
 
204
  /**
208
  function coupon_can_be_applied($coupon) {
209
  global $woocommerce;
210
 
211
+ $can_be_applied = true;
212
+
213
  //Test validity
214
  if ( ! $coupon->is_valid() ) {
215
+ $can_be_applied = false;
216
  }
217
  //Test individual use
218
+ elseif ( $coupon->individual_use == 'yes' && count( $woocommerce->cart->applied_coupons ) != 0 ) {
219
+ $can_be_applied = false;
220
  }
 
221
  //Test restricted emails
222
  //See WooCommerce: class-wc-cart.php function check_customer_coupons
223
+ elseif ( is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
224
  $user_emails = array_map( 'sanitize_email', array_map( 'strtolower', $this->get_user_emails() ) );
225
  $coupon_emails = array_map( 'sanitize_email', array_map( 'strtolower', $coupon->customer_email ) );
226
 
227
  if ( 0 == sizeof( array_intersect( $user_emails, $coupon_emails ) ) ) {
228
+ $can_be_applied = false;
229
  }
230
  }
231
 
232
+ return apply_filters( 'wjecf_coupon_can_be_applied', $can_be_applied, $coupon );
233
+
234
+ }
235
+
236
+ /**
237
+ * Does the coupon have a value? (autocoupon should not be applied if it has no value)
238
+ * @param WC_Coupon $coupon The coupon data
239
+ * @return bool True if it has a value (discount, free shipping, whatever) otherwise false)
240
+ **/
241
+ function coupon_has_a_value($coupon) {
242
+
243
+ $has_a_value = false;
244
 
245
  if ( $coupon->enable_free_shipping() ) {
246
+ $has_a_value = true;
247
+ } else {
248
+ //Test whether discount > 0
249
+ //See WooCommerce: class-wc-cart.php function get_discounted_price
250
+ global $woocommerce;
251
+ foreach ( $woocommerce->cart->get_cart() as $cart_item) {
252
+ if ( $coupon->is_valid_for_cart() || $coupon->is_valid_for_product( $cart_item['data'], $cart_item ) ) {
253
+ if ( $coupon->get_discount_amount( $cart_item['data']->price, $cart_item ) > 0 ) {
254
+ $has_a_value = true;
255
+ break;
256
+ }
257
  }
258
  }
259
  }
260
 
261
+ return apply_filters( 'wjecf_coupon_has_a_value', $has_a_value, $coupon );
262
+
263
  }
264
 
265
 
 
 
266
  /**
267
  * Remove unmatched autocoupons. No message will be shown.
268
  * NOTE: This function must be called before WooCommerce removes the coupon, to inhibit WooCommerces "coupon not valid"-message!
269
+ * @return bool True if coupons were removed, otherwise False;
270
  */
271
  function remove_unmatched_autocoupons() {
272
  global $woocommerce;
273
 
274
+ $calc_needed = false;
275
  foreach ( $this->get_all_auto_coupons() as $coupon_code ) {
276
  if ( $woocommerce->cart->has_discount( $coupon_code ) ) {
277
  $coupon = new WC_Coupon($coupon_code);
278
  if ( ! $this->coupon_can_be_applied($coupon) ) {
279
+ //$this->log( sprintf( "Removing %s", $coupon_code ) );
280
  WC()->cart->remove_coupon( $coupon_code );
281
+ $calc_needed = true;
282
  }
283
  }
284
  }
285
+ return $calc_needed;
286
  }
287
 
288
  /**
289
  * Overwrite the default "Coupon added" notice with a more descriptive message.
290
  * @param WC_Coupon $coupon The coupon data
291
+ * @param bool $remove_message_only If true the notice will be removed, and no notice will be shown.
292
  * @return void
293
  */
294
+ private function overwrite_success_message( $coupon, $remove_message_only = false ) {
295
  $succss_msg = $coupon->get_coupon_message( WC_Coupon::WC_COUPON_SUCCESS );
296
 
297
+ //If ajax, remove only
298
+ $remove_message_only |= defined('DOING_AJAX') && DOING_AJAX;
299
+
300
  $new_succss_msg = sprintf(
301
  __("Discount applied: %s", 'woocommerce-jos-autocoupon'),
302
  __($this->coupon_excerpt($coupon), 'woocommerce-jos-autocoupon')
305
  //Compatibility woocommerce-2-1-notice-api
306
  if ( function_exists('wc_get_notices') ) {
307
  $all_notices = wc_get_notices();
308
+ if ( ! isset( $all_notices['success'] ) ) {
309
+ $all_notices['success'] = array();
310
+ }
311
  $messages = $all_notices['success'];
312
  } else {
313
  $messages = $woocommerce->messages;
317
  for( $y=0; $y < $sizeof_messages; $y++ ) {
318
  if ( $messages[$y] == $succss_msg ) {
319
  if ( isset($all_notices) ) {
320
+ if ( $remove_message_only ) {
321
  unset ( $all_notices['success'][$y] );
322
  } else {
323
  $all_notices['success'][$y] = $new_succss_msg;
325
 
326
  WC()->session->set( 'wc_notices', $all_notices );
327
  } else {
328
+ if ( $remove_message_only ) {
329
  unset ( $messages[$y] );
330
  } else {
331
  $messages[$y] = $new_succss_msg;
343
  * @return bool true if it is an "Auto coupon"
344
  */
345
  private function is_auto_coupon($coupon) {
346
+ return get_post_meta( $coupon->id, '_wjecf_is_auto_coupon', true ) == 'yes';
347
  }
348
 
349
 
369
  $current_user = wp_get_current_user();
370
  $this->_user_emails[] = $current_user->user_email;
371
  }
372
+
373
+ if ( isset( $_POST['billing_email'] ) )
374
+ $this->_user_emails[] = $_POST['billing_email'];
375
  }
376
+ //$this->log( "User emails: " . join( ",", $this->_user_emails ) );
377
  return $this->_user_emails;
378
  }
379
 
387
  if ( ! is_array( $append_emails ) ) {
388
  $append_emails = array( $append_emails );
389
  }
390
+ $this->_user_emails = array_unique( array_merge( $this->get_user_emails(), $append_emails ) );
391
+ //$this->log('Append emails: ' . join( ',', $append_emails ) );
392
  }
393
 
394
+ public function fetch_billing_email( $post_data ) {
395
+ //post_data can be an array, or a query=string&like=this
396
+ if ( ! is_array( $post_data ) ) {
397
+ parse_str( $post_data, $posted );
398
+ } else {
399
+ $posted = $post_data;
400
+ }
401
+
 
 
 
402
  if ( isset ( $posted['billing_email'] ) ) {
403
  $this->append_user_emails( $posted['billing_email'] );
404
  }
405
 
406
+ }
 
 
 
 
 
 
 
 
407
 
408
  /**
409
  * Get a list of all auto coupon codes
411
  */
412
  private function get_all_auto_coupons() {
413
 
414
+ if ( ! is_array( $this->_autocoupon_codes ) ) {
415
  $this->_autocoupon_codes = array();
416
 
417
  $query_args = array(
421
  'orderby' => 'title',
422
  'meta_query' => array(
423
  array(
424
+ 'key' => '_wjecf_is_auto_coupon',
425
  'value' => 'yes',
426
  'compare' => '=',
427
  ),
439
  return $this->_autocoupon_codes;
440
  }
441
 
442
+ //FOR DEBUGGING ONLY
443
  private function log ( $string ) {
444
+ // file_put_contents ( "/lamp/www/logfile.log", date("Y-m-d | h:i:sa") . " " . current_filter() . ": " . $string . "\n" , FILE_APPEND );
445
  }
446
  }
includes/wjecf-coupon-extensions.php CHANGED
@@ -4,6 +4,7 @@
4
  defined('ABSPATH') or die();
5
 
6
  class WC_Jos_Extended_Coupon_Features_Controller {
 
7
 
8
  public function __construct() {
9
  add_action('init', array( &$this, 'controller_init' ));
@@ -13,37 +14,138 @@ class WC_Jos_Extended_Coupon_Features_Controller {
13
  if ( ! class_exists('WC_Coupon') ) {
14
  return;
15
  }
16
-
17
- //Admin hooks
18
- add_action( 'woocommerce_coupon_options_usage_restriction', array( $this, 'coupon_options' ), 10, 0 );
19
- add_action( 'woocommerce_process_shop_coupon_meta', array( $this, 'process_shop_coupon_meta' ), 10, 2 );
20
 
 
 
 
 
 
21
  //Frontend hooks
22
  add_filter('woocommerce_coupon_is_valid', array( &$this, 'coupon_is_valid' ), 10, 2 );
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  /* ADMIN HOOKS */
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- public function coupon_options() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  global $thepostid, $post;
29
  $thepostid = empty( $thepostid ) ? $post->ID : $thepostid;
30
 
31
  //See WooCommerce class-wc-meta-box-coupon-data.php function ouput
32
 
33
- //Title
34
- echo "<h3 style='display:inline'>" . __( 'Extended Coupon Features', 'woocommerce-jos-autocoupon' ) . "</h3>\n";
35
- printf( '<a href="%s" title="Support the development" target="_blank">', $this->get_donate_url() );
36
- _e('Donate to the developer', 'woocommerce-jos-autocoupon' );
37
- echo "</a>\n";
38
 
 
39
  // AND in stead of OR the products
40
  woocommerce_wp_checkbox( array(
41
  'id' => '_wjecf_products_and',
42
  'label' => __( 'AND Products (not OR)', 'woocommerce-jos-autocoupon' ),
43
- 'description' => __( 'Check this box if ALL of the products (see above) must be in the cart to use this coupon (in stead of only one of the products).', 'woocommerce-jos-autocoupon' )
44
  ) );
45
 
 
 
 
 
 
 
 
 
 
46
 
 
 
 
 
 
 
 
 
 
 
 
47
  //Trick to show AND or OR next to the product_ids field
48
  $label_and = __( '(AND)', 'woocommerce-jos-autocoupon' );
49
  $label_or = __( '(OR)', 'woocommerce-jos-autocoupon' );
@@ -53,51 +155,128 @@ class WC_Jos_Extended_Coupon_Features_Controller {
53
  //Update AND or OR in product_ids label when checkbox value changes
54
  jQuery("#_wjecf_products_and").click(
55
  function() {
56
- jQuery("#wjecf_products_and_label").text(
57
- jQuery("#_wjecf_products_and").attr('checked') ? "<?php echo $label_and; ?>" : "<?php echo $label_or; ?>"
58
  );
59
  } );
60
  //Append AND/OR to the product_ids label
61
- jQuery(".form-field:has('[name=\"product_ids\"]') label").append( ' <strong><span id="wjecf_products_and_label"><?php echo $label; ?></span></strong>' );
62
  </script>
63
  <?php //End of the AND/OR trick
64
 
65
 
 
66
  // Shipping methods
67
  ?>
68
  <p class="form-field"><label for="wjecf_shipping_methods"><?php _e( 'Shipping methods', 'woocommerce-jos-autocoupon' ); ?></label>
69
  <select id="wjecf_shipping_methods" name="wjecf_shipping_methods[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any shipping method', 'woocommerce-jos-autocoupon' ); ?>">
70
  <?php
71
- $shipping_method_ids = (array) get_post_meta( $thepostid, '_wjecf_shipping_methods', true );
72
  $shipping_methods = WC()->shipping->load_shipping_methods();
73
 
74
  if ( $shipping_methods ) foreach ( $shipping_methods as $shipping_method ) {
75
- echo '<option value="' . esc_attr( $shipping_method->id ) . '"' . selected( in_array( $shipping_method->id, $shipping_method_ids ), true, false ) . '>' . esc_html( $shipping_method->method_title ) . '</option>';
76
  }
77
  ?>
78
  </select> <img class="help_tip" data-tip='<?php _e( 'One of these shipping methods must be selected in order for this coupon to be valid.', 'woocommerce-jos-autocoupon' ); ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
79
  <?php
80
 
 
81
  // Payment methods
82
  ?>
83
  <p class="form-field"><label for="wjecf_payment_methods"><?php _e( 'Payment methods', 'woocommerce-jos-autocoupon' ); ?></label>
84
- <select id="wjecf_payment_methods" name="wjecf_payment_methods[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any shipping method', 'woocommerce-jos-autocoupon' ); ?>">
85
  <?php
86
- $payment_method_ids = (array) get_post_meta( $thepostid, '_wjecf_payment_methods', true );
87
  //DONT USE: CAN CRASH IN UNKNOWN OCCASIONS // $payment_methods = WC()->payment_gateways->available_payment_gateways();
88
  $payment_methods = WC()->payment_gateways->payment_gateways();
89
  if ( $payment_methods ) foreach ( $payment_methods as $payment_method ) {
90
  if ('yes' === $payment_method->enabled) {
91
- echo '<option value="' . esc_attr( $payment_method->id ) . '"' . selected( in_array( $payment_method->id, $payment_method_ids ), true, false ) . '>' . esc_html( $payment_method->title ) . '</option>';
92
  }
93
  }
94
  ?>
95
  </select> <img class="help_tip" data-tip='<?php _e( 'One of these payment methods must be selected in order for this coupon to be valid.', 'woocommerce-jos-autocoupon' ); ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
96
  <?php
 
 
 
 
 
 
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
100
  public function process_shop_coupon_meta( $post_id, $post ) {
 
 
 
 
 
 
101
  $wjecf_products_and = isset( $_POST['_wjecf_products_and'] ) ? 'yes' : 'no';
102
  update_post_meta( $post_id, '_wjecf_products_and', $wjecf_products_and );
103
 
@@ -107,6 +286,15 @@ class WC_Jos_Extended_Coupon_Features_Controller {
107
  $wjecf_payment_methods = isset( $_POST['wjecf_payment_methods'] ) ? $_POST['wjecf_payment_methods'] : '';
108
  update_post_meta( $post_id, '_wjecf_payment_methods', $wjecf_payment_methods );
109
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  /* FRONTEND HOOKS */
@@ -118,6 +306,7 @@ class WC_Jos_Extended_Coupon_Features_Controller {
118
  return false;
119
  }
120
 
 
121
  //Test if ALL products are in the cart (if AND-operator selected in stead of the default OR)
122
  $products_and = get_post_meta( $coupon->id, '_wjecf_products_and', true ) == 'yes';
123
  if ( $products_and && sizeof( $coupon->product_ids ) > 1 ) { // We use > 1, because if size == 1, 'AND' makes no difference
@@ -136,8 +325,34 @@ class WC_Jos_Extended_Coupon_Features_Controller {
136
  }
137
 
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  //Test restricted shipping methods
140
- $shipping_method_ids = $this->get_shipping_method_ids( $coupon );
141
  if ( sizeof( $shipping_method_ids ) > 0 ) {
142
  $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
143
  $chosen_shipping = $chosen_shipping_methods[0];
@@ -147,28 +362,126 @@ class WC_Jos_Extended_Coupon_Features_Controller {
147
  }
148
  }
149
 
 
150
  //Test restricted payment methods
151
- $payment_method_ids = $this->get_payment_method_ids( $coupon );
152
  if ( sizeof( $payment_method_ids ) > 0 ) {
153
- $chosen_payment_method = isset( WC()->session->chosen_payment_method ) ? WC()->session->chosen_payment_method : array();
154
-
155
- if ( ! in_array( $chosen_payment_method, $payment_method_ids ) ) {
156
- return false;
157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
  return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  }
 
 
162
 
163
  //
164
 
165
  /**
166
  * Get array of the selected shipping methods ids.
167
- * @param WC_Coupon $coupon The coupon data
168
  * @return array Id's of the shipping methods or an empty array.
169
  */
170
- private function get_shipping_method_ids($coupon) {
171
- $v = get_post_meta( $coupon->id, '_wjecf_shipping_methods', true );
172
  if ($v == '') {
173
  $v = array();
174
  }
@@ -178,11 +491,11 @@ class WC_Jos_Extended_Coupon_Features_Controller {
178
 
179
  /**
180
  * Get array of the selected payment method ids.
181
- * @param WC_Coupon $coupon The coupon data
182
  * @return array Id's of the payment methods or an empty array.
183
  */
184
- private function get_payment_method_ids($coupon) {
185
- $v = get_post_meta( $coupon->id, '_wjecf_payment_methods', true );
186
  if ($v == '') {
187
  $v = array();
188
  }
@@ -190,6 +503,51 @@ class WC_Jos_Extended_Coupon_Features_Controller {
190
  return $v;
191
  }
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  public static function get_donate_url() {
194
  return "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
195
  }
4
  defined('ABSPATH') or die();
5
 
6
  class WC_Jos_Extended_Coupon_Features_Controller {
7
+ private $options = false;
8
 
9
  public function __construct() {
10
  add_action('init', array( &$this, 'controller_init' ));
14
  if ( ! class_exists('WC_Coupon') ) {
15
  return;
16
  }
 
 
 
 
17
 
18
+ $this->init_options();
19
+
20
+ //Admin hooks
21
+ add_action( 'admin_init', array( &$this, 'admin_init' ) );
22
+
23
  //Frontend hooks
24
  add_filter('woocommerce_coupon_is_valid', array( &$this, 'coupon_is_valid' ), 10, 2 );
25
  }
26
 
27
+ public function init_options() {
28
+ $this->options = get_option( 'wjecf_options' );
29
+ if (false === $this->options) {
30
+ $this->options = array( 'db_version' => 0 );
31
+ }
32
+ }
33
+
34
+ //Upgrade options on version change
35
+ public function auto_upgrade_options() {
36
+ $current_db_version = 1;
37
+ //Check version
38
+ if ( $this->options['db_version'] < $current_db_version ) {
39
+ global $wpdb;
40
+
41
+ //DB_VERSION 1: Since 2.1.0-b5
42
+ if ($this->options['db_version'] < 1) {
43
+ //RENAME meta_key _wjecf_matching_product_qty TO _wjecf_min_matching_product_qty
44
+ $where = array("meta_key" => "_wjecf_matching_product_qty");
45
+ $set = array('meta_key' => "_wjecf_min_matching_product_qty");
46
+ $wpdb->update( _get_meta_table('post'), $set, $where );
47
+
48
+ //RENAME meta_key woocommerce-jos-autocoupon TO _wjecf_is_auto_coupon
49
+ $where = array("meta_key" => "woocommerce-jos-autocoupon");
50
+ $set = array('meta_key' => "_wjecf_is_auto_coupon");
51
+ $wpdb->update( _get_meta_table('post'), $set, $where );
52
+ //Now we're version 1
53
+ $this->options['db_version'] = 1;
54
+ }
55
+
56
+ // Write options to database
57
+ update_option( 'wjecf_options' , $this->options, false );
58
+ }
59
+ }
60
+
61
+
62
+
63
  /* ADMIN HOOKS */
64
+ public function admin_init() {
65
+ //Upgrade options on version change
66
+ $this->auto_upgrade_options();
67
+
68
+ //Admin hooks
69
+ add_filter( 'woocommerce_coupon_data_tabs', array( $this, 'admin_coupon_options_tabs' ), 10, 1);
70
+ add_action( 'woocommerce_coupon_data_panels', array( $this, 'admin_coupon_options_panels' ), 10, 0 );
71
+
72
+ add_action( 'wjecf_woocommerce_coupon_options_extended_features', array( $this, 'admin_coupon_options_extended_features' ), 10, 0 );
73
+ add_action( 'woocommerce_process_shop_coupon_meta', array( $this, 'process_shop_coupon_meta' ), 10, 2 );
74
+ }
75
 
76
+ //Add panels to the coupon option page
77
+ public function admin_coupon_options_panels() {
78
+ ?>
79
+ <div id="wjecf_extended_features_coupon_data" class="panel woocommerce_options_panel">
80
+ <h3 style='display:inline'><?php echo esc_html( __( 'Extended Coupon Features', 'woocommerce-jos-autocoupon' ) ); ?></h3>
81
+
82
+ <?php
83
+ //Feed the panel with options
84
+ do_action( 'wjecf_woocommerce_coupon_options_extended_features' );
85
+ ?>
86
+
87
+ <h3><?php _e( 'Do you find WooCommerce Extended Coupon Features useful?', 'woocommerce-jos-autocoupon'); ?></h3>
88
+ <p class="form-field"><label for="wjecf_donate_button"><?php
89
+ echo esc_html( __('Express your gratitude', 'woocommerce-jos-autocoupon' ) );
90
+ ?></label>
91
+ <a id="wjecf_donate_button" href="<?php echo $this->get_donate_url(); ?>" target="_blank" class="button button-primary">
92
+ <?php
93
+ echo esc_html( __('Donate to the developer', 'woocommerce-jos-autocoupon' ) );
94
+ ?></a>
95
+ </p>
96
+ </div>
97
+ <?php
98
+
99
+ }
100
+
101
+ //Add tabs to the coupon option page
102
+ public function admin_coupon_options_tabs( $tabs ) {
103
+
104
+ $tabs['extended_features'] = array(
105
+ 'label' => __( 'Extended features', 'woocommerce-jos-autocoupon' ),
106
+ 'target' => 'wjecf_extended_features_coupon_data',
107
+ 'class' => 'wjecf_extended_features_coupon_data',
108
+ );
109
+ return $tabs;
110
+ }
111
+
112
+ //Tab 'extended features'
113
+ public function admin_coupon_options_extended_features() {
114
  global $thepostid, $post;
115
  $thepostid = empty( $thepostid ) ? $post->ID : $thepostid;
116
 
117
  //See WooCommerce class-wc-meta-box-coupon-data.php function ouput
118
 
 
 
 
 
 
119
 
120
+ //=============================
121
  // AND in stead of OR the products
122
  woocommerce_wp_checkbox( array(
123
  'id' => '_wjecf_products_and',
124
  'label' => __( 'AND Products (not OR)', 'woocommerce-jos-autocoupon' ),
125
+ 'description' => __( 'Check this box if ALL of the products (see tab \'usage restriction\') must be in the cart to use this coupon (in stead of only one of the products).', 'woocommerce-jos-autocoupon' )
126
  ) );
127
 
128
+ // Minimum quantity of matching products (product/category)
129
+ woocommerce_wp_text_input( array(
130
+ 'id' => '_wjecf_min_matching_product_qty',
131
+ 'label' => __( 'Minimum quantity of matching products', 'woocommerce-jos-autocoupon' ),
132
+ 'placeholder' => __( 'No minimum', 'woocommerce' ),
133
+ 'description' => __( 'Minimum quantity of the products that match the given product or category restrictions (see tab \'usage restriction\'). If no product or category restrictions are specified, the total number of products is used.', 'woocommerce-jos-autocoupon' ),
134
+ 'data_type' => 'decimal',
135
+ 'desc_tip' => true
136
+ ) );
137
 
138
+ // Minimum quantity of matching products (product/category)
139
+ woocommerce_wp_text_input( array(
140
+ 'id' => '_wjecf_max_matching_product_qty',
141
+ 'label' => __( 'Maximum quantity of matching products', 'woocommerce-jos-autocoupon' ),
142
+ 'placeholder' => __( 'No maximum', 'woocommerce' ),
143
+ 'description' => __( 'Maximum quantity of the products that match the given product or category restrictions (see tab \'usage restriction\'). If no product or category restrictions are specified, the total number of products is used.', 'woocommerce-jos-autocoupon' ),
144
+ 'data_type' => 'decimal',
145
+ 'desc_tip' => true
146
+ ) );
147
+
148
+ //=============================
149
  //Trick to show AND or OR next to the product_ids field
150
  $label_and = __( '(AND)', 'woocommerce-jos-autocoupon' );
151
  $label_or = __( '(OR)', 'woocommerce-jos-autocoupon' );
155
  //Update AND or OR in product_ids label when checkbox value changes
156
  jQuery("#_wjecf_products_and").click(
157
  function() {
158
+ jQuery("#wjecf_products_and_label").html(
159
+ jQuery("#_wjecf_products_and").attr('checked') ? '<?php echo esc_js( $label_and ); ?>' : '<?php echo esc_js( $label_or ); ?>'
160
  );
161
  } );
162
  //Append AND/OR to the product_ids label
163
+ jQuery(".form-field:has('[name=\"product_ids\"]') label").append( ' <strong><span id="wjecf_products_and_label"><?php echo esc_html( $label ); ?></span></strong>' );
164
  </script>
165
  <?php //End of the AND/OR trick
166
 
167
 
168
+ //=============================
169
  // Shipping methods
170
  ?>
171
  <p class="form-field"><label for="wjecf_shipping_methods"><?php _e( 'Shipping methods', 'woocommerce-jos-autocoupon' ); ?></label>
172
  <select id="wjecf_shipping_methods" name="wjecf_shipping_methods[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any shipping method', 'woocommerce-jos-autocoupon' ); ?>">
173
  <?php
174
+ $coupon_shipping_method_ids = $this->get_coupon_shipping_method_ids( $thepostid );
175
  $shipping_methods = WC()->shipping->load_shipping_methods();
176
 
177
  if ( $shipping_methods ) foreach ( $shipping_methods as $shipping_method ) {
178
+ echo '<option value="' . esc_attr( $shipping_method->id ) . '"' . selected( in_array( $shipping_method->id, $coupon_shipping_method_ids ), true, false ) . '>' . esc_html( $shipping_method->method_title ) . '</option>';
179
  }
180
  ?>
181
  </select> <img class="help_tip" data-tip='<?php _e( 'One of these shipping methods must be selected in order for this coupon to be valid.', 'woocommerce-jos-autocoupon' ); ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
182
  <?php
183
 
184
+ //=============================
185
  // Payment methods
186
  ?>
187
  <p class="form-field"><label for="wjecf_payment_methods"><?php _e( 'Payment methods', 'woocommerce-jos-autocoupon' ); ?></label>
188
+ <select id="wjecf_payment_methods" name="wjecf_payment_methods[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any payment method', 'woocommerce-jos-autocoupon' ); ?>">
189
  <?php
190
+ $coupon_payment_method_ids = $this->get_coupon_payment_method_ids( $thepostid );
191
  //DONT USE: CAN CRASH IN UNKNOWN OCCASIONS // $payment_methods = WC()->payment_gateways->available_payment_gateways();
192
  $payment_methods = WC()->payment_gateways->payment_gateways();
193
  if ( $payment_methods ) foreach ( $payment_methods as $payment_method ) {
194
  if ('yes' === $payment_method->enabled) {
195
+ echo '<option value="' . esc_attr( $payment_method->id ) . '"' . selected( in_array( $payment_method->id, $coupon_payment_method_ids ), true, false ) . '>' . esc_html( $payment_method->title ) . '</option>';
196
  }
197
  }
198
  ?>
199
  </select> <img class="help_tip" data-tip='<?php _e( 'One of these payment methods must be selected in order for this coupon to be valid.', 'woocommerce-jos-autocoupon' ); ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
200
  <?php
201
+
202
+
203
+ //=============================
204
+ //Title: "CUSTOMER RESTRICTIONS"
205
+ echo "<h3 style='display:inline'>" . esc_html( __( 'Customer restrictions', 'woocommerce-jos-autocoupon' ) ). "</h3>\n";
206
+ echo "<p><span class='description'>" . __( 'If both a customer and a role restriction are supplied, matching either one of them will suffice.' , 'woocommerce-jos-autocoupon' ) . "</span></p>\n";
207
 
208
+ //=============================
209
+ // User ids
210
+ ?>
211
+ <p class="form-field"><label><?php _e( 'Allowed Customers', 'woocommerce-jos-autocoupon' ); ?></label>
212
+ <input type="hidden" class="wc-customer-search" data-multiple="true" style="width: 50%;" name="wjecf_customer_ids" data-placeholder="<?php _e( 'Any customer', 'woocommerce-jos-autocoupon' ); ?>" data-action="woocommerce_json_search_customers" data-selected="<?php
213
+ $coupon_customer_ids = $this->get_coupon_customer_ids( $thepostid );
214
+ $json_ids = array();
215
+
216
+ foreach ( $coupon_customer_ids as $customer_id ) {
217
+ $customer = get_userdata( $customer_id );
218
+ if ( is_object( $customer ) ) {
219
+ $json_ids[ $customer_id ] = $customer->display_name . ' (#' . $customer->ID . ' &ndash; ' . sanitize_email( $customer->user_email ) . ')';
220
+ }
221
+ }
222
+
223
+ echo esc_attr( json_encode( $json_ids ) );
224
+ ?>" value="<?php echo implode( ',', array_keys( $json_ids ) ); ?>" /> <img class="help_tip" data-tip='<?php
225
+ _e( 'Only these customers may use this coupon.', 'woocommerce-jos-autocoupon' );
226
+ ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
227
+ <?php
228
+
229
+ //=============================
230
+ // User roles
231
+ ?>
232
+ <p class="form-field"><label for="wjecf_customer_roles"><?php _e( 'Allowed User Roles', 'woocommerce-jos-autocoupon' ); ?></label>
233
+ <select id="wjecf_customer_roles" name="wjecf_customer_roles[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any role', 'woocommerce-jos-autocoupon' ); ?>">
234
+ <?php
235
+ $coupon_customer_roles = $this->get_coupon_customer_roles( $thepostid );
236
+
237
+ $available_customer_roles = array_reverse( get_editable_roles() );
238
+ foreach ( $available_customer_roles as $role_id => $role ) {
239
+ $role_name = translate_user_role($role['name'] );
240
+
241
+ echo '<option value="' . esc_attr( $role_id ) . '"'
242
+ . selected( in_array( $role_id, $coupon_customer_roles ), true, false ) . '>'
243
+ . esc_html( $role_name ) . '</option>';
244
+ }
245
+ ?>
246
+ </select> <img class="help_tip" data-tip='<?php
247
+ _e( 'Only these User Roles may use this coupon.', 'woocommerce-jos-autocoupon' );
248
+ ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
249
+ <?php
250
+
251
+ //=============================
252
+ // Excluded user roles
253
+ ?>
254
+ <p class="form-field"><label for="wjecf_excluded_customer_roles"><?php _e( 'Disallowed User Roles', 'woocommerce-jos-autocoupon' ); ?></label>
255
+ <select id="wjecf_customer_roles" name="wjecf_excluded_customer_roles[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php _e( 'Any role', 'woocommerce-jos-autocoupon' ); ?>">
256
+ <?php
257
+ $coupon_excluded_customer_roles = $this->get_coupon_excluded_customer_roles( $thepostid );
258
+
259
+ foreach ( $available_customer_roles as $role_id => $role ) {
260
+ $role_name = translate_user_role($role['name'] );
261
+
262
+ echo '<option value="' . esc_attr( $role_id ) . '"'
263
+ . selected( in_array( $role_id, $coupon_excluded_customer_roles ), true, false ) . '>'
264
+ . esc_html( $role_name ) . '</option>';
265
+ }
266
+ ?>
267
+ </select> <img class="help_tip" data-tip='<?php
268
+ _e( 'These User Roles will be specifically excluded from using this coupon.', 'woocommerce-jos-autocoupon' );
269
+ ?>' src="<?php echo WC()->plugin_url(); ?>/assets/images/help.png" height="16" width="16" /></p>
270
+ <?php
271
  }
272
 
273
  public function process_shop_coupon_meta( $post_id, $post ) {
274
+ $wjecf_min_matching_product_qty = isset( $_POST['_wjecf_min_matching_product_qty'] ) ? $_POST['_wjecf_min_matching_product_qty'] : '';
275
+ update_post_meta( $post_id, '_wjecf_min_matching_product_qty', $wjecf_min_matching_product_qty );
276
+
277
+ $wjecf_max_matching_product_qty = isset( $_POST['_wjecf_max_matching_product_qty'] ) ? $_POST['_wjecf_max_matching_product_qty'] : '';
278
+ update_post_meta( $post_id, '_wjecf_max_matching_product_qty', $wjecf_max_matching_product_qty );
279
+
280
  $wjecf_products_and = isset( $_POST['_wjecf_products_and'] ) ? 'yes' : 'no';
281
  update_post_meta( $post_id, '_wjecf_products_and', $wjecf_products_and );
282
 
286
  $wjecf_payment_methods = isset( $_POST['wjecf_payment_methods'] ) ? $_POST['wjecf_payment_methods'] : '';
287
  update_post_meta( $post_id, '_wjecf_payment_methods', $wjecf_payment_methods );
288
 
289
+ $wjecf_customer_ids = implode(",", array_filter( array_map( 'intval', explode(",", $_POST['wjecf_customer_ids']) ) ) );
290
+ update_post_meta( $post_id, '_wjecf_customer_ids', $wjecf_customer_ids );
291
+
292
+ $wjecf_customer_roles = isset( $_POST['wjecf_customer_roles'] ) ? $_POST['wjecf_customer_roles'] : '';
293
+ update_post_meta( $post_id, '_wjecf_customer_roles', $wjecf_customer_roles );
294
+
295
+ $wjecf_excluded_customer_roles = isset( $_POST['wjecf_excluded_customer_roles'] ) ? $_POST['wjecf_excluded_customer_roles'] : '';
296
+ update_post_meta( $post_id, '_wjecf_excluded_customer_roles', $wjecf_excluded_customer_roles );
297
+
298
  }
299
 
300
  /* FRONTEND HOOKS */
306
  return false;
307
  }
308
 
309
+ //============================
310
  //Test if ALL products are in the cart (if AND-operator selected in stead of the default OR)
311
  $products_and = get_post_meta( $coupon->id, '_wjecf_products_and', true ) == 'yes';
312
  if ( $products_and && sizeof( $coupon->product_ids ) > 1 ) { // We use > 1, because if size == 1, 'AND' makes no difference
325
  }
326
 
327
 
328
+ //============================
329
+ //Test min/max quantity of matching products
330
+ //
331
+ //For all items in the cart:
332
+ // If coupon contains both a product AND category inclusion filter: the item is counted if it matches either one of them
333
+ // If coupon contains either a product OR category exclusion filter: the item will NOT be counted if it matches either one of them
334
+ // If sale items are excluded by the coupon: the item will NOT be counted if it is a sale item
335
+ // If no filter exist, all items will be counted
336
+ $min_matching_product_qty = intval(get_post_meta( $coupon->id, '_wjecf_min_matching_product_qty', true ));
337
+ $max_matching_product_qty = intval(get_post_meta( $coupon->id, '_wjecf_max_matching_product_qty', true ));
338
+ if ( $min_matching_product_qty > 0 || $max_matching_product_qty > 0 ) {
339
+ //Count the products
340
+ $qty = 0;
341
+ foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
342
+ $_product = $cart_item['data'];
343
+ if ($this->coupon_is_valid_for_product( $coupon, $_product )) {
344
+ $qty += $cart_item['quantity'];
345
+ }
346
+ }
347
+ //Validate range
348
+ if ($min_matching_product_qty > 0 && $qty < $min_matching_product_qty) return false;
349
+ if ($max_matching_product_qty > 0 && $qty > $max_matching_product_qty) return false;
350
+ }
351
+
352
+
353
+ //============================
354
  //Test restricted shipping methods
355
+ $shipping_method_ids = $this->get_coupon_shipping_method_ids( $coupon->id );
356
  if ( sizeof( $shipping_method_ids ) > 0 ) {
357
  $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
358
  $chosen_shipping = $chosen_shipping_methods[0];
362
  }
363
  }
364
 
365
+ //============================
366
  //Test restricted payment methods
367
+ $payment_method_ids = $this->get_coupon_payment_method_ids( $coupon->id );
368
  if ( sizeof( $payment_method_ids ) > 0 ) {
369
+ $chosen_payment_method = isset( WC()->session->chosen_payment_method ) ? WC()->session->chosen_payment_method : array();
370
+
371
+ if ( ! in_array( $chosen_payment_method, $payment_method_ids ) ) {
372
+ return false;
373
+ }
374
+ }
375
+
376
+
377
+ //============================
378
+ //Test restricted user ids and roles
379
+ //NOTE: If both customer id and role restrictions are provided, the coupon matches if either the id or the role matches
380
+ $coupon_customer_ids = $this->get_coupon_customer_ids( $coupon->id );
381
+ $coupon_customer_roles = $this->get_coupon_customer_roles( $coupon->id );
382
+ if ( sizeof( $coupon_customer_ids ) > 0 || sizeof( $coupon_customer_roles ) > 0 ) {
383
+ $user = wp_get_current_user();
384
+
385
+ //If both fail we invalidate. Otherwise it's ok
386
+ if ( ! in_array( $user->ID, $coupon_customer_ids ) && ! array_intersect( $user->roles, $coupon_customer_roles ) ) {
387
+ return false;
388
+ }
389
+ }
390
+
391
+ //============================
392
+ //Test excluded user roles
393
+ $coupon_excluded_customer_roles = $this->get_coupon_excluded_customer_roles( $coupon->id );
394
+ if ( sizeof( $coupon_excluded_customer_roles ) > 0 ) {
395
+ $user = wp_get_current_user();
396
+
397
+ //Excluded customer roles
398
+ if ( array_intersect( $user->roles, $coupon_excluded_customer_roles ) ) {
399
+ return false;
400
+ }
401
  }
402
 
403
  return true;
404
+ }
405
+
406
+
407
+
408
+ //Test if coupon is valid for the product
409
+ // (this function is used to count the quantity of matching products)
410
+ private function coupon_is_valid_for_product( $coupon, $product, $values = array() ) {
411
+ //===================================================================
412
+ //This is almost a duplicate of function is_valid_for_product in WooCommerce class-wc-coupon.php
413
+ //The only differences are:
414
+ // - I removed the verification for fixed_product or percent_product
415
+ // - I replaced $this with $coupon
416
+ //===================================================================
417
+
418
+ //if ( ! $this->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
419
+ // return apply_filters( 'woocommerce_coupon_is_valid_for_product', false, $product, $this, $values );
420
+ //}
421
+
422
+ $valid = false;
423
+ $product_cats = wp_get_post_terms( $product->id, 'product_cat', array( "fields" => "ids" ) );
424
+
425
+ // Specific products get the discount
426
+ if ( sizeof( $coupon->product_ids ) > 0 ) {
427
+ if ( in_array( $product->id, $coupon->product_ids ) || ( isset( $product->variation_id ) && in_array( $product->variation_id, $coupon->product_ids ) ) || in_array( $product->get_parent(), $coupon->product_ids ) ) {
428
+ $valid = true;
429
+ }
430
+ }
431
+
432
+ // Category discounts
433
+ if ( sizeof( $coupon->product_categories ) > 0 ) {
434
+ if ( sizeof( array_intersect( $product_cats, $coupon->product_categories ) ) > 0 ) {
435
+ $valid = true;
436
+ }
437
+ }
438
+
439
+ if ( ! sizeof( $coupon->product_ids ) && ! sizeof( $coupon->product_categories ) ) {
440
+ // No product ids - all items discounted
441
+ $valid = true;
442
+ }
443
+
444
+ // Specific product ID's excluded from the discount
445
+ if ( sizeof( $coupon->exclude_product_ids ) > 0 ) {
446
+ if ( in_array( $product->id, $coupon->exclude_product_ids ) || ( isset( $product->variation_id ) && in_array( $product->variation_id, $coupon->exclude_product_ids ) ) || in_array( $product->get_parent(), $coupon->exclude_product_ids ) ) {
447
+ $valid = false;
448
+ }
449
+ }
450
+
451
+ // Specific categories excluded from the discount
452
+ if ( sizeof( $coupon->exclude_product_categories ) > 0 ) {
453
+ if ( sizeof( array_intersect( $product_cats, $coupon->exclude_product_categories ) ) > 0 ) {
454
+ $valid = false;
455
+ }
456
+ }
457
+
458
+ // Sale Items excluded from discount
459
+ if ( $coupon->exclude_sale_items == 'yes' ) {
460
+ $product_ids_on_sale = wc_get_product_ids_on_sale();
461
+
462
+ if ( isset( $product->variation_id ) ) {
463
+ if ( in_array( $product->variation_id, $product_ids_on_sale, true ) ) {
464
+ $valid = false;
465
+ }
466
+ } elseif ( in_array( $product->id, $product_ids_on_sale, true ) ) {
467
+ $valid = false;
468
+ }
469
+ }
470
+
471
+ return apply_filters( 'woocommerce_coupon_is_valid_for_product', $valid, $product, $coupon, $values );
472
  }
473
+
474
+
475
 
476
  //
477
 
478
  /**
479
  * Get array of the selected shipping methods ids.
480
+ * @param int $coupon_id The coupon id
481
  * @return array Id's of the shipping methods or an empty array.
482
  */
483
+ private function get_coupon_shipping_method_ids($coupon_id) {
484
+ $v = get_post_meta( $coupon_id, '_wjecf_shipping_methods', true );
485
  if ($v == '') {
486
  $v = array();
487
  }
491
 
492
  /**
493
  * Get array of the selected payment method ids.
494
+ * @param int $coupon_id The coupon id
495
  * @return array Id's of the payment methods or an empty array.
496
  */
497
+ private function get_coupon_payment_method_ids($coupon_id) {
498
+ $v = get_post_meta( $coupon_id, '_wjecf_payment_methods', true );
499
  if ($v == '') {
500
  $v = array();
501
  }
503
  return $v;
504
  }
505
 
506
+ /**
507
+ * Get array of the selected customer ids.
508
+ * @param int $coupon_id The coupon id
509
+ * @return array Id's of the customers (users) or an empty array.
510
+ */
511
+ private function get_coupon_customer_ids($coupon_id) {
512
+ $v = get_post_meta( $coupon_id, '_wjecf_customer_ids', true );
513
+ //$v = array_map( 'intval', explode(",", get_post_meta( $coupon_id, '_wjecf_customer_ids', true ) ) );
514
+ if ($v == '') {
515
+ $v = array();
516
+ } else {
517
+ $v = array_map( 'intval', explode(",", $v ) );
518
+ }
519
+
520
+ return $v;
521
+ }
522
+
523
+ /**
524
+ * Get array of the selected customer role ids.
525
+ * @param int $coupon_id The coupon id
526
+ * @return array Id's (string) of the customer roles or an empty array.
527
+ */
528
+ private function get_coupon_customer_roles($coupon_id) {
529
+ $v = get_post_meta( $coupon_id, '_wjecf_customer_roles', true );
530
+ if ($v == '') {
531
+ $v = array();
532
+ }
533
+
534
+ return $v;
535
+ }
536
+
537
+ /**
538
+ * Get array of the excluded customer role ids.
539
+ * @param int $coupon_id The coupon id
540
+ * @return array Id's (string) of the excluded customer roles or an empty array.
541
+ */
542
+ private function get_coupon_excluded_customer_roles($coupon_id) {
543
+ $v = get_post_meta( $coupon_id, '_wjecf_excluded_customer_roles', true );
544
+ if ($v == '') {
545
+ $v = array();
546
+ }
547
+
548
+ return $v;
549
+ }
550
+
551
  public static function get_donate_url() {
552
  return "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted";
553
  }
languages/woocommerce-jos-autocoupon-de_DE.mo CHANGED
Binary file
languages/woocommerce-jos-autocoupon-de_DE.po CHANGED
@@ -3,70 +3,158 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
7
- "added-coupons\n"
8
- "POT-Creation-Date: 2015-05-03 21:01+0100\n"
9
- "PO-Revision-Date: 2015-05-04 23:21+0100\n"
10
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
- "Language-Team: LANGUAGE <LL@li.org>\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.5.7\n"
 
 
 
16
 
17
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:49
18
  msgid "Auto coupon"
19
  msgstr "Automatisch einlösen"
20
 
21
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:50
22
  msgid ""
23
- "Automatically add the coupon to the cart if the restrictions are met. Please "
24
- "enter a description when you check this box, the description will be shown "
25
- "in the customers cart if the coupon is applied."
26
  msgstr ""
27
- "Diesen Coupon im Warenkorb automatisch einlösen, wenn die Bedingungen "
28
- "erfüllt wurden. Bitte geben Sie eine Beschreibung ein. Wenn Sie das Häkchen "
29
- "setzen wird die Beschreibung im Warenkorb des Nutzers angezeigt, sobald der "
30
- "Coupon eingelöst wurde."
31
 
32
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:111
 
 
 
 
 
 
 
 
33
  msgid "Free shipping coupon"
34
  msgstr "Gratis verzending kortingsbon"
35
 
36
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:218
37
  #, php-format
38
  msgid "Discount applied: %s"
39
  msgstr "Automatischer Rabatt: %s"
40
 
41
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:32
42
  msgid "Extended Coupon Features"
43
  msgstr ""
44
 
45
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:34
46
  msgid "Donate to the developer"
47
  msgstr ""
48
 
49
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  msgid "Shipping methods"
51
  msgstr ""
52
 
53
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:40
54
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:55
55
  msgid "Any shipping method"
56
  msgstr ""
57
 
58
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:49
59
- msgid ""
60
- "One of these shipping methods must be selected in order for this coupon to "
61
- "be valid."
62
  msgstr ""
63
 
64
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:54
65
  msgid "Payment methods"
66
  msgstr ""
67
 
68
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:64
 
 
 
 
 
 
 
 
 
 
 
 
69
  msgid ""
70
- "One of these payment methods must be selected in order for this coupon to be "
71
- "valid."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  msgstr ""
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-added-coupons\n"
7
+ "POT-Creation-Date: 2015-08-14 22:52+0100\n"
8
+ "PO-Revision-Date: 2015-08-14 22:52+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "Language: de_DE\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.1\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-Basepath: c:\\lamp\\www\\qrvm_woo\n"
18
+ "X-Poedit-SearchPath-0: wp-content\\plugins\\woocommerce-auto-added-coupons\n"
19
 
20
+ #: includes/wjecf-autocoupon.php:48 includes/wjecf-autocoupon.php:55
21
  msgid "Auto coupon"
22
  msgstr "Automatisch einlösen"
23
 
24
+ #: includes/wjecf-autocoupon.php:56
25
  msgid ""
26
+ "Automatically add the coupon to the cart if the restrictions are met. Please enter a "
27
+ "description when you check this box, the description will be shown in the customer's cart if "
28
+ "the coupon is applied."
29
  msgstr ""
30
+ "Diesen Coupon im Warenkorb automatisch einlösen, wenn die Bedingungen erfüllt wurden. Bitte "
31
+ "geben Sie eine Beschreibung ein. Wenn Sie das Häkchen setzen wird die Beschreibung im "
32
+ "Warenkorb des Nutzers angezeigt, sobald der Coupon eingelöst wurde."
 
33
 
34
+ #: includes/wjecf-autocoupon.php:63
35
+ msgid "Apply silently"
36
+ msgstr ""
37
+
38
+ #: includes/wjecf-autocoupon.php:64
39
+ msgid "Don't display a message when this coupon is automatically applied."
40
+ msgstr ""
41
+
42
+ #: includes/wjecf-autocoupon.php:143
43
  msgid "Free shipping coupon"
44
  msgstr "Gratis verzending kortingsbon"
45
 
46
+ #: includes/wjecf-autocoupon.php:284
47
  #, php-format
48
  msgid "Discount applied: %s"
49
  msgstr "Automatischer Rabatt: %s"
50
 
51
+ #: includes/wjecf-coupon-extensions.php:36
52
  msgid "Extended Coupon Features"
53
  msgstr ""
54
 
55
+ #: includes/wjecf-coupon-extensions.php:39
56
  msgid "Donate to the developer"
57
  msgstr ""
58
 
59
+ #: includes/wjecf-coupon-extensions.php:54
60
+ msgid "Extended features"
61
+ msgstr ""
62
+
63
+ #: includes/wjecf-coupon-extensions.php:73
64
+ msgid "AND Products (not OR)"
65
+ msgstr ""
66
+
67
+ #: includes/wjecf-coupon-extensions.php:74
68
+ msgid ""
69
+ "Check this box if ALL of the products (see tab 'usage restriction') must be in the cart to "
70
+ "use this coupon (in stead of only one of the products)."
71
+ msgstr ""
72
+
73
+ #: includes/wjecf-coupon-extensions.php:80
74
+ msgid "Minimum quantity of matching products"
75
+ msgstr ""
76
+
77
+ #: includes/wjecf-coupon-extensions.php:81
78
+ msgid "No minimum"
79
+ msgstr ""
80
+
81
+ #: includes/wjecf-coupon-extensions.php:82
82
+ msgid ""
83
+ "Minimum quantity of the products that match the given product or category restrictions (see "
84
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
85
+ "number of products is used."
86
+ msgstr ""
87
+
88
+ #: includes/wjecf-coupon-extensions.php:89
89
+ msgid "(AND)"
90
+ msgstr ""
91
+
92
+ #: includes/wjecf-coupon-extensions.php:90
93
+ msgid "(OR)"
94
+ msgstr ""
95
+
96
+ #: includes/wjecf-coupon-extensions.php:110
97
  msgid "Shipping methods"
98
  msgstr ""
99
 
100
+ #: includes/wjecf-coupon-extensions.php:111
 
101
  msgid "Any shipping method"
102
  msgstr ""
103
 
104
+ #: includes/wjecf-coupon-extensions.php:120
105
+ msgid "One of these shipping methods must be selected in order for this coupon to be valid."
 
 
106
  msgstr ""
107
 
108
+ #: includes/wjecf-coupon-extensions.php:126
109
  msgid "Payment methods"
110
  msgstr ""
111
 
112
+ #: includes/wjecf-coupon-extensions.php:127
113
+ msgid "Any payment method"
114
+ msgstr ""
115
+
116
+ #: includes/wjecf-coupon-extensions.php:138
117
+ msgid "One of these payment methods must be selected in order for this coupon to be valid."
118
+ msgstr ""
119
+
120
+ #: includes/wjecf-coupon-extensions.php:144
121
+ msgid "Customer restrictions"
122
+ msgstr ""
123
+
124
+ #: includes/wjecf-coupon-extensions.php:145
125
  msgid ""
126
+ "If both a customer and a role restriction are supplied, matching either one of them will "
127
+ "suffice."
128
+ msgstr ""
129
+
130
+ #: includes/wjecf-coupon-extensions.php:150
131
+ msgid "Customers"
132
+ msgstr ""
133
+
134
+ #: includes/wjecf-coupon-extensions.php:151
135
+ msgid "Any customer"
136
+ msgstr ""
137
+
138
+ #: includes/wjecf-coupon-extensions.php:163
139
+ msgid "Coupon only applies to these customers."
140
+ msgstr ""
141
+
142
+ #: includes/wjecf-coupon-extensions.php:169
143
+ msgid "Customer roles"
144
+ msgstr ""
145
+
146
+ #: includes/wjecf-coupon-extensions.php:170 includes/wjecf-coupon-extensions.php:190
147
+ msgid "Any role"
148
+ msgstr ""
149
+
150
+ #: includes/wjecf-coupon-extensions.php:183
151
+ msgid "The customer must have one of these roles in order for this coupon to be valid."
152
+ msgstr ""
153
+
154
+ #: includes/wjecf-coupon-extensions.php:189
155
+ msgid "Excluded customer roles"
156
+ msgstr ""
157
+
158
+ #: includes/wjecf-coupon-extensions.php:202
159
+ msgid "The customer must not have one of these roles in order for this coupon to be valid."
160
  msgstr ""
languages/woocommerce-jos-autocoupon-es_ES.mo CHANGED
Binary file
languages/woocommerce-jos-autocoupon-es_ES.po CHANGED
@@ -3,106 +3,217 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
7
- "added-coupons\n"
8
- "POT-Creation-Date: 2015-05-04 23:28+0100\n"
9
- "PO-Revision-Date: 2015-05-04 23:32+0100\n"
10
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
- "Language-Team: LANGUAGE <LL@li.org>\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.5.7\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
  "X-Poedit-Basepath: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins\\\n"
18
  "X-Poedit-SearchPath-0: woocommerce-auto-added-coupons\n"
19
 
20
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:49
21
  msgid "Auto coupon"
22
  msgstr "Aplicar cupón automaticamente"
23
 
24
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:50
25
  msgid ""
26
- "Automatically add the coupon to the cart if the restrictions are met. Please "
27
- "enter a description when you check this box, the description will be shown "
28
- "in the customers cart if the coupon is applied."
29
  msgstr ""
30
- "Aplicar el cupón automaticamente al carrito de compras cuando los requisitos "
31
- "sean cumplidos. Por favor ingrese una descripción, ya que este será mostrado "
32
- "al cliente cuando el cupón esté aplicado."
33
 
34
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:111
 
 
 
 
 
 
 
 
35
  msgid "Free shipping coupon"
36
  msgstr "Cupón para envío gratis"
37
 
38
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:222
39
  #, php-format
40
  msgid "Discount applied: %s"
41
  msgstr "Descuento aplicado: %s"
42
 
43
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:34
44
  msgid "Extended Coupon Features"
45
- msgstr "Más opciones para cupones"
 
 
 
 
46
 
47
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:36
 
 
 
 
48
  msgid "Donate to the developer"
49
  msgstr "Hacer una donación"
50
 
51
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:42
 
 
 
 
52
  msgid "AND Products (not OR)"
53
  msgstr "TODOS los productos"
54
 
55
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:43
56
  msgid ""
57
- "Check this box if ALL of the products (see above) must be in the cart to use "
58
- "this coupon (in stead of only one of the products)."
59
  msgstr ""
60
- "Marque esta casilla si TODOS los productos (ve arriba) tienen que estar en "
61
- "el carrito para poder usar este cupón (en lugar de solo uno de los "
62
- "productos)."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:48
 
 
 
 
 
 
 
 
 
 
 
65
  msgid "(AND)"
66
  msgstr "(TODOS)"
67
 
68
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:49
69
  msgid "(OR)"
70
  msgstr "(UNO)"
71
 
72
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:68
73
  msgid "Shipping methods"
74
  msgstr "Métodos de envío"
75
 
76
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:69
77
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:84
78
  msgid "Any shipping method"
79
- msgstr "Métodos de pago"
80
 
81
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:78
82
- msgid ""
83
- "One of these shipping methods must be selected in order for this coupon to "
84
- "be valid."
85
- msgstr ""
86
- "Uno de estos métodos de pago tiene que ser seleccionado para usar este cupón."
87
 
88
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:83
89
  msgid "Payment methods"
90
  msgstr "Métodos de pago"
91
 
92
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:95
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid ""
94
- "One of these payment methods must be selected in order for this coupon to be "
95
- "valid."
96
  msgstr ""
97
- "Uno de estos métodos de envío tiene que ser seleccionado para usar este "
98
- "cupón."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  #~ msgid ""
101
- #~ "Allow discounts to be automatically added to the cart when it's "
102
- #~ "restrictions are met. Allow applying coupons via an url."
103
  #~ msgstr ""
104
- #~ "Aplicar ciertos cupónes automaticamente al carrito de compras cuando los "
105
- #~ "requisitos sean cumplidos. Aplicar cupones a través de la url. "
106
 
107
  #~ msgid "WooCommerce auto added coupons"
108
  #~ msgstr "WooCommerce auto added coupons"
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-added-coupons\n"
7
+ "POT-Creation-Date: 2015-08-15 20:21+0100\n"
8
+ "PO-Revision-Date: 2015-08-15 20:38+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "Language: es_ES\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.1\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
  "X-Poedit-Basepath: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins\\\n"
18
  "X-Poedit-SearchPath-0: woocommerce-auto-added-coupons\n"
19
 
20
+ #: includes/wjecf-autocoupon.php:49 includes/wjecf-autocoupon.php:56
21
  msgid "Auto coupon"
22
  msgstr "Aplicar cupón automaticamente"
23
 
24
+ #: includes/wjecf-autocoupon.php:57
25
  msgid ""
26
+ "Automatically add the coupon to the cart if the restrictions are met. Please enter a "
27
+ "description when you check this box, the description will be shown in the customer's cart if "
28
+ "the coupon is applied."
29
  msgstr ""
30
+ "Aplicar el cupón automaticamente al carrito de compras cuando los requisitos sean cumplidos. "
31
+ "Por favor ingrese una descripción, ya que este será mostrado al cliente cuando el cupón esté "
32
+ "aplicado."
33
 
34
+ #: includes/wjecf-autocoupon.php:64
35
+ msgid "Apply silently"
36
+ msgstr "Aplicar sin mensaje"
37
+
38
+ #: includes/wjecf-autocoupon.php:65
39
+ msgid "Don't display a message when this coupon is automatically applied."
40
+ msgstr "No mostrar mensaje cuando el cupon esté aplicado automaticamente."
41
+
42
+ #: includes/wjecf-autocoupon.php:144
43
  msgid "Free shipping coupon"
44
  msgstr "Cupón para envío gratis"
45
 
46
+ #: includes/wjecf-autocoupon.php:285
47
  #, php-format
48
  msgid "Discount applied: %s"
49
  msgstr "Descuento aplicado: %s"
50
 
51
+ #: includes/wjecf-coupon-extensions.php:80
52
  msgid "Extended Coupon Features"
53
+ msgstr "Opciones extendidas para el cupón"
54
+
55
+ #: includes/wjecf-coupon-extensions.php:87
56
+ msgid "Do you find WooCommerce Extended Coupon Features useful?"
57
+ msgstr "Le gusta WooCommerce Extended Coupon Features?"
58
 
59
+ #: includes/wjecf-coupon-extensions.php:89
60
+ msgid "Express your gratitude"
61
+ msgstr "Exprese su gratitud"
62
+
63
+ #: includes/wjecf-coupon-extensions.php:93
64
  msgid "Donate to the developer"
65
  msgstr "Hacer una donación"
66
 
67
+ #: includes/wjecf-coupon-extensions.php:105
68
+ msgid "Extended features"
69
+ msgstr "Opciones extendidas"
70
+
71
+ #: includes/wjecf-coupon-extensions.php:124
72
  msgid "AND Products (not OR)"
73
  msgstr "TODOS los productos"
74
 
75
+ #: includes/wjecf-coupon-extensions.php:125
76
  msgid ""
77
+ "Check this box if ALL of the products (see tab 'usage restriction') must be in the cart to "
78
+ "use this coupon (in stead of only one of the products)."
79
  msgstr ""
80
+ "Marque esta casilla si TODOS los productos (vea 'Restricción de uso') necesitan estar en el "
81
+ "carrito de compras (en lugar de uno de los productos)."
82
+
83
+ #: includes/wjecf-coupon-extensions.php:131
84
+ msgid "Minimum quantity of matching products"
85
+ msgstr "Cantidad mínima de productos conformes."
86
+
87
+ #: includes/wjecf-coupon-extensions.php:132
88
+ msgid "No minimum"
89
+ msgstr "Sin mínimo"
90
+
91
+ #: includes/wjecf-coupon-extensions.php:133
92
+ msgid ""
93
+ "Minimum quantity of the products that match the given product or category restrictions (see "
94
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
95
+ "number of products is used."
96
+ msgstr "Cantidad mínima de productos conformes (vea 'Restricción de uso')."
97
+
98
+ #: includes/wjecf-coupon-extensions.php:141
99
+ msgid "Maximum quantity of matching products"
100
+ msgstr "Cantidad máxima de productos conformes."
101
 
102
+ #: includes/wjecf-coupon-extensions.php:142
103
+ msgid "No maximum"
104
+ msgstr "Sin máximo"
105
+
106
+ #: includes/wjecf-coupon-extensions.php:143
107
+ msgid ""
108
+ "Maximum quantity of the products that match the given product or category restrictions (see "
109
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
110
+ "number of products is used."
111
+ msgstr "Cantidad mánima de productos conformes (vea 'Restricción de uso')."
112
+
113
+ #: includes/wjecf-coupon-extensions.php:150
114
  msgid "(AND)"
115
  msgstr "(TODOS)"
116
 
117
+ #: includes/wjecf-coupon-extensions.php:151
118
  msgid "(OR)"
119
  msgstr "(UNO)"
120
 
121
+ #: includes/wjecf-coupon-extensions.php:171
122
  msgid "Shipping methods"
123
  msgstr "Métodos de envío"
124
 
125
+ #: includes/wjecf-coupon-extensions.php:172
 
126
  msgid "Any shipping method"
127
+ msgstr "Métodos de envío"
128
 
129
+ #: includes/wjecf-coupon-extensions.php:181
130
+ msgid "One of these shipping methods must be selected in order for this coupon to be valid."
131
+ msgstr "Uno de estos métodos de pago tiene que ser seleccionado para usar este cupón."
 
 
 
132
 
133
+ #: includes/wjecf-coupon-extensions.php:187
134
  msgid "Payment methods"
135
  msgstr "Métodos de pago"
136
 
137
+ #: includes/wjecf-coupon-extensions.php:188
138
+ msgid "Any payment method"
139
+ msgstr "Métodos de pago"
140
+
141
+ #: includes/wjecf-coupon-extensions.php:199
142
+ msgid "One of these payment methods must be selected in order for this coupon to be valid."
143
+ msgstr "Uno de estos métodos de envío tiene que ser seleccionado para usar este cupón."
144
+
145
+ #: includes/wjecf-coupon-extensions.php:205
146
+ msgid "Customer restrictions"
147
+ msgstr "Restricción de clientes"
148
+
149
+ #: includes/wjecf-coupon-extensions.php:206
150
  msgid ""
151
+ "If both a customer and a role restriction are supplied, matching either one of them will "
152
+ "suffice."
153
  msgstr ""
154
+ "Si se ha introducido tanto una restricción de cliente como una restricción de perfil, "
155
+ "coincide uno de ellos será suficiente."
156
+
157
+ #: includes/wjecf-coupon-extensions.php:211
158
+ msgid "Allowed Customers"
159
+ msgstr "Clientes"
160
+
161
+ #: includes/wjecf-coupon-extensions.php:212
162
+ msgid "Any customer"
163
+ msgstr "Clientes"
164
+
165
+ #: includes/wjecf-coupon-extensions.php:225
166
+ msgid "Only these customers may use this coupon."
167
+ msgstr "Solo estos clientes pueden usar este cupón."
168
+
169
+ #: includes/wjecf-coupon-extensions.php:232
170
+ msgid "Allowed User Roles"
171
+ msgstr "Perfiles del cliente"
172
+
173
+ #: includes/wjecf-coupon-extensions.php:233 includes/wjecf-coupon-extensions.php:255
174
+ msgid "Any role"
175
+ msgstr "Perfiles del cliente"
176
+
177
+ #: includes/wjecf-coupon-extensions.php:247
178
+ msgid "Only these User Roles may use this coupon."
179
+ msgstr "Solo clientes con este perfil pueden usar este cupón."
180
+
181
+ #: includes/wjecf-coupon-extensions.php:254
182
+ msgid "Disallowed User Roles"
183
+ msgstr "Perfiles del cliente excluidos"
184
+
185
+ #: includes/wjecf-coupon-extensions.php:268
186
+ msgid "These User Roles will be specifically excluded from using this coupon."
187
+ msgstr "Clientes con este perfil no pueden usar este cupón."
188
+
189
+ #~ msgid "Customers"
190
+ #~ msgstr "Clientes"
191
+
192
+ #~ msgid "Coupon only applies to these customers."
193
+ #~ msgstr "Cupón sólo aplicable para estos clientes."
194
+
195
+ #~ msgid "Customer roles"
196
+ #~ msgstr "Perfiles del cliente"
197
+
198
+ #~ msgid "The customer must have one of these roles in order for this coupon to be valid."
199
+ #~ msgstr "El cliente ha de tener este perfil para poder user este cupón."
200
+
201
+ #~ msgid "Excluded customer roles"
202
+ #~ msgstr "Perfiles restringidos"
203
+
204
+ #~ msgid ""
205
+ #~ "Check this box if ALL of the products (see above) must be in the cart to use this coupon "
206
+ #~ "(in stead of only one of the products)."
207
+ #~ msgstr ""
208
+ #~ "Marque esta casilla si TODOS los productos (ve arriba) tienen que estar en el carrito para "
209
+ #~ "poder usar este cupón (en lugar de solo uno de los productos)."
210
 
211
  #~ msgid ""
212
+ #~ "Allow discounts to be automatically added to the cart when it's restrictions are met. "
213
+ #~ "Allow applying coupons via an url."
214
  #~ msgstr ""
215
+ #~ "Aplicar ciertos cupónes automaticamente al carrito de compras cuando los requisitos sean "
216
+ #~ "cumplidos. Aplicar cupones a través de la url. "
217
 
218
  #~ msgid "WooCommerce auto added coupons"
219
  #~ msgstr "WooCommerce auto added coupons"
languages/woocommerce-jos-autocoupon-nb_NO.mo CHANGED
Binary file
languages/woocommerce-jos-autocoupon-nb_NO.po CHANGED
@@ -3,96 +3,175 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
7
- "added-coupons\n"
8
- "POT-Creation-Date: 2015-05-04 23:49+0100\n"
9
- "PO-Revision-Date: 2015-05-04 23:49+0100\n"
10
  "Last-Translator: Anders Sorensen <anders@zorensen.no>\n"
11
  "Language-Team: \n"
12
  "Language: nb\n"
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
- "X-Generator: Poedit 1.5.7\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-KeywordsList: __;_e\n"
19
  "X-Poedit-Basepath: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins\\\n"
20
  "X-Poedit-SearchPath-0: woocommerce-auto-added-coupons\n"
21
 
22
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:49
23
  msgid "Auto coupon"
24
  msgstr "Automatisk rabattkupong"
25
 
26
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:50
27
  msgid ""
28
- "Automatically add the coupon to the cart if the restrictions are met. Please "
29
- "enter a description when you check this box, the description will be shown "
30
- "in the customers cart if the coupon is applied."
31
  msgstr ""
32
- "Legg rabattkupong automatisk til handlekurven om kravene er oppfylt. "
33
- "Vennligst skriv inn en beskrivelse når du velger denne boksen. Beskrivelsen "
34
- "vil bli vist i handlekurven om rabattkupongen blir lagt til."
35
 
36
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:111
 
 
 
 
 
 
 
 
37
  msgid "Free shipping coupon"
38
  msgstr "Gratis frakt kupong"
39
 
40
- #: woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:222
41
  #, php-format
42
  msgid "Discount applied: %s"
43
  msgstr "Rabatt: %s"
44
 
45
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:34
46
  msgid "Extended Coupon Features"
47
  msgstr "Utvidet kupong funksjoner"
48
 
49
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:36
50
  msgid "Donate to the developer"
51
  msgstr "Donèr til utvikleren"
52
 
53
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:42
 
 
 
 
54
  msgid "AND Products (not OR)"
55
  msgstr ""
56
 
57
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  msgid ""
59
- "Check this box if ALL of the products (see above) must be in the cart to use "
60
- "this coupon (in stead of only one of the products)."
 
 
 
 
 
 
 
 
 
61
  msgstr ""
62
 
63
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:48
 
 
 
 
 
 
 
64
  msgid "(AND)"
65
  msgstr ""
66
 
67
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:49
68
  msgid "(OR)"
69
  msgstr ""
70
 
71
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:68
72
  msgid "Shipping methods"
73
  msgstr "Fraktmetoder"
74
 
75
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:69
76
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:84
77
  msgid "Any shipping method"
78
  msgstr "Alle metoder"
79
 
80
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:78
81
- msgid ""
82
- "One of these shipping methods must be selected in order for this coupon to "
83
- "be valid."
84
- msgstr ""
85
- "En av disse faktmetodene må være valgt for at denne kupongen skal være "
86
- "gyldig."
87
 
88
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:83
89
  msgid "Payment methods"
90
  msgstr "Betalingsmåter"
91
 
92
- #: woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:95
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid ""
94
- "One of these payment methods must be selected in order for this coupon to be "
95
- "valid."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  msgstr ""
97
- "En av disse betalingsmetodene må være valgt for at denne kupongen skal være "
98
- "valgt."
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-added-coupons\n"
7
+ "POT-Creation-Date: 2015-08-15 15:09+0100\n"
8
+ "PO-Revision-Date: 2015-08-15 15:09+0100\n"
 
9
  "Last-Translator: Anders Sorensen <anders@zorensen.no>\n"
10
  "Language-Team: \n"
11
  "Language: nb\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.1\n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "X-Poedit-KeywordsList: __;_e\n"
18
  "X-Poedit-Basepath: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins\\\n"
19
  "X-Poedit-SearchPath-0: woocommerce-auto-added-coupons\n"
20
 
21
+ #: includes/wjecf-autocoupon.php:49 includes/wjecf-autocoupon.php:56
22
  msgid "Auto coupon"
23
  msgstr "Automatisk rabattkupong"
24
 
25
+ #: includes/wjecf-autocoupon.php:57
26
  msgid ""
27
+ "Automatically add the coupon to the cart if the restrictions are met. Please enter a "
28
+ "description when you check this box, the description will be shown in the customer's cart if "
29
+ "the coupon is applied."
30
  msgstr ""
31
+ "Legg rabattkupong automatisk til handlekurven om kravene er oppfylt. Vennligst skriv inn en "
32
+ "beskrivelse når du velger denne boksen. Beskrivelsen vil bli vist i handlekurven om "
33
+ "rabattkupongen blir lagt til."
34
 
35
+ #: includes/wjecf-autocoupon.php:64
36
+ msgid "Apply silently"
37
+ msgstr ""
38
+
39
+ #: includes/wjecf-autocoupon.php:65
40
+ msgid "Don't display a message when this coupon is automatically applied."
41
+ msgstr ""
42
+
43
+ #: includes/wjecf-autocoupon.php:144
44
  msgid "Free shipping coupon"
45
  msgstr "Gratis frakt kupong"
46
 
47
+ #: includes/wjecf-autocoupon.php:285
48
  #, php-format
49
  msgid "Discount applied: %s"
50
  msgstr "Rabatt: %s"
51
 
52
+ #: includes/wjecf-coupon-extensions.php:82
53
  msgid "Extended Coupon Features"
54
  msgstr "Utvidet kupong funksjoner"
55
 
56
+ #: includes/wjecf-coupon-extensions.php:85
57
  msgid "Donate to the developer"
58
  msgstr "Donèr til utvikleren"
59
 
60
+ #: includes/wjecf-coupon-extensions.php:100
61
+ msgid "Extended features"
62
+ msgstr ""
63
+
64
+ #: includes/wjecf-coupon-extensions.php:119
65
  msgid "AND Products (not OR)"
66
  msgstr ""
67
 
68
+ #: includes/wjecf-coupon-extensions.php:120
69
+ msgid ""
70
+ "Check this box if ALL of the products (see tab 'usage restriction') must be in the cart to "
71
+ "use this coupon (in stead of only one of the products)."
72
+ msgstr ""
73
+
74
+ #: includes/wjecf-coupon-extensions.php:126
75
+ msgid "Minimum quantity of matching products"
76
+ msgstr ""
77
+
78
+ #: includes/wjecf-coupon-extensions.php:127
79
+ msgid "No minimum"
80
+ msgstr ""
81
+
82
+ #: includes/wjecf-coupon-extensions.php:128
83
  msgid ""
84
+ "Minimum quantity of the products that match the given product or category restrictions (see "
85
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
86
+ "number of products is used."
87
+ msgstr ""
88
+
89
+ #: includes/wjecf-coupon-extensions.php:136
90
+ msgid "Maximum quantity of matching products"
91
+ msgstr ""
92
+
93
+ #: includes/wjecf-coupon-extensions.php:137
94
+ msgid "No maximum"
95
  msgstr ""
96
 
97
+ #: includes/wjecf-coupon-extensions.php:138
98
+ msgid ""
99
+ "Maximum quantity of the products that match the given product or category restrictions (see "
100
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
101
+ "number of products is used."
102
+ msgstr ""
103
+
104
+ #: includes/wjecf-coupon-extensions.php:145
105
  msgid "(AND)"
106
  msgstr ""
107
 
108
+ #: includes/wjecf-coupon-extensions.php:146
109
  msgid "(OR)"
110
  msgstr ""
111
 
112
+ #: includes/wjecf-coupon-extensions.php:166
113
  msgid "Shipping methods"
114
  msgstr "Fraktmetoder"
115
 
116
+ #: includes/wjecf-coupon-extensions.php:167
 
117
  msgid "Any shipping method"
118
  msgstr "Alle metoder"
119
 
120
+ #: includes/wjecf-coupon-extensions.php:176
121
+ msgid "One of these shipping methods must be selected in order for this coupon to be valid."
122
+ msgstr "En av disse faktmetodene være valgt for at denne kupongen skal være gyldig."
 
 
 
 
123
 
124
+ #: includes/wjecf-coupon-extensions.php:182
125
  msgid "Payment methods"
126
  msgstr "Betalingsmåter"
127
 
128
+ #: includes/wjecf-coupon-extensions.php:183
129
+ #, fuzzy
130
+ msgid "Any payment method"
131
+ msgstr "Betalingsmåter"
132
+
133
+ #: includes/wjecf-coupon-extensions.php:194
134
+ msgid "One of these payment methods must be selected in order for this coupon to be valid."
135
+ msgstr "En av disse betalingsmetodene må være valgt for at denne kupongen skal være valgt."
136
+
137
+ #: includes/wjecf-coupon-extensions.php:200
138
+ msgid "Customer restrictions"
139
+ msgstr ""
140
+
141
+ #: includes/wjecf-coupon-extensions.php:201
142
  msgid ""
143
+ "If both a customer and a role restriction are supplied, matching either one of them will "
144
+ "suffice."
145
+ msgstr ""
146
+
147
+ #: includes/wjecf-coupon-extensions.php:206
148
+ msgid "Allowed Customers"
149
+ msgstr ""
150
+
151
+ #: includes/wjecf-coupon-extensions.php:207
152
+ msgid "Any customer"
153
+ msgstr ""
154
+
155
+ #: includes/wjecf-coupon-extensions.php:220
156
+ msgid "Only these customers may use this coupon."
157
+ msgstr ""
158
+
159
+ #: includes/wjecf-coupon-extensions.php:227
160
+ msgid "Allowed User Roles"
161
+ msgstr ""
162
+
163
+ #: includes/wjecf-coupon-extensions.php:228 includes/wjecf-coupon-extensions.php:250
164
+ msgid "Any role"
165
+ msgstr ""
166
+
167
+ #: includes/wjecf-coupon-extensions.php:242
168
+ msgid "Only these User Roles may use this coupon."
169
+ msgstr ""
170
+
171
+ #: includes/wjecf-coupon-extensions.php:249
172
+ msgid "Disallowed User Roles"
173
+ msgstr ""
174
+
175
+ #: includes/wjecf-coupon-extensions.php:263
176
+ msgid "These User Roles will be specifically excluded from using this coupon."
177
  msgstr ""
 
 
languages/woocommerce-jos-autocoupon-nl_NL.mo CHANGED
Binary file
languages/woocommerce-jos-autocoupon-nl_NL.po CHANGED
@@ -3,98 +3,225 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
7
- "added-coupons\n"
8
- "POT-Creation-Date: 2015-05-04 23:22+0100\n"
9
- "PO-Revision-Date: 2015-05-05 00:19+0100\n"
10
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
- "Language-Team: LANGUAGE <LL@li.org>\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.5.7\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
- "X-Poedit-Basepath: .\n"
18
- "X-Poedit-SearchPath-0: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins"
19
- "\\woocommerce-auto-added-coupons\n"
20
 
21
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:49
22
  msgid "Auto coupon"
23
  msgstr "Automatisch toepassen"
24
 
25
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:50
26
  msgid ""
27
- "Automatically add the coupon to the cart if the restrictions are met. Please "
28
- "enter a description when you check this box, the description will be shown "
29
- "in the customers cart if the coupon is applied."
30
  msgstr ""
31
- "Voeg de kortingsbon automatisch toe aan het winkelwagentje als aan alle "
32
- "voorwaarden wordt voldaan. Vult u a.u.b. een omschrijving in als u deze "
33
- "optie aanvinkt, de omschrijving zal aan de klant worden getoond wanneer de "
34
- "kortingsbon wordt toegevoegd."
35
 
36
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:111
 
 
 
 
 
 
 
 
37
  msgid "Free shipping coupon"
38
  msgstr "Gratis verzending kortingsbon"
39
 
40
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:222
41
  #, php-format
42
  msgid "Discount applied: %s"
43
  msgstr "Korting toegepast: %s"
44
 
45
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:34
46
  msgid "Extended Coupon Features"
47
- msgstr "Uitgebreide Kortingsbon Eigenschappen"
 
 
 
 
48
 
49
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:36
 
 
 
 
50
  msgid "Donate to the developer"
51
  msgstr "Doneer aan de ontwikkelaar"
52
 
53
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:42
 
 
 
 
54
  msgid "AND Products (not OR)"
55
  msgstr "ALLE Producten (niet OF)"
56
 
57
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  msgid ""
59
- "Check this box if ALL of the products (see above) must be in the cart to use "
60
- "this coupon (in stead of only one of the products)."
 
61
  msgstr ""
62
- "Aanvinken als ALLE producten (zie boven) in de winkelwagen moeten zitten om "
63
- "deze kortingsbon te kunnen gebruiken (in plaats van één van de producten)."
 
64
 
65
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  msgid "(AND)"
67
  msgstr "(ALLE)"
68
 
69
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:49
70
  msgid "(OR)"
71
  msgstr "(OF)"
72
 
73
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:68
74
  msgid "Shipping methods"
75
  msgstr "Verzendmethoden"
76
 
77
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:69
78
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:84
79
  msgid "Any shipping method"
80
  msgstr "Verzendmethoden"
81
 
82
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:78
83
- msgid ""
84
- "One of these shipping methods must be selected in order for this coupon to "
85
- "be valid."
86
- msgstr ""
87
- "Een van deze verzendmethoden moet gekozen zijn om deze kortingsbon te kunnen "
88
- "gebruiken."
89
 
90
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:83
91
  msgid "Payment methods"
92
  msgstr "Betaalmethoden"
93
 
94
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:95
 
 
 
 
 
 
 
 
 
 
 
 
95
  msgid ""
96
- "One of these payment methods must be selected in order for this coupon to be "
97
- "valid."
98
  msgstr ""
99
- "Een van deze betaalmethoden moet gekozen zijn om deze kortingsbon te kunnen "
100
- "gebruiken."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WooCommerce auto added coupons 1.1.3.1\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-added-coupons\n"
7
+ "POT-Creation-Date: 2015-08-15 20:20+0100\n"
8
+ "PO-Revision-Date: 2015-08-15 20:39+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "Language: nl_NL\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.1\n"
16
  "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-Basepath: ..\\\n"
18
+ "X-Poedit-SearchPath-0: .\n"
 
19
 
20
+ #: includes/wjecf-autocoupon.php:49 includes/wjecf-autocoupon.php:56
21
  msgid "Auto coupon"
22
  msgstr "Automatisch toepassen"
23
 
24
+ #: includes/wjecf-autocoupon.php:57
25
  msgid ""
26
+ "Automatically add the coupon to the cart if the restrictions are met. Please enter a "
27
+ "description when you check this box, the description will be shown in the customer's cart if "
28
+ "the coupon is applied."
29
  msgstr ""
30
+ "Voeg de kortingsbon automatisch toe aan het winkelwagentje als aan alle voorwaarden wordt "
31
+ "voldaan. Vult u a.u.b. een omschrijving in als u deze optie aanvinkt, de omschrijving zal aan "
32
+ "de klant worden getoond wanneer de kortingsbon wordt toegevoegd."
 
33
 
34
+ #: includes/wjecf-autocoupon.php:64
35
+ msgid "Apply silently"
36
+ msgstr "Toepassen zonder melding"
37
+
38
+ #: includes/wjecf-autocoupon.php:65
39
+ msgid "Don't display a message when this coupon is automatically applied."
40
+ msgstr "Geen melding weergeven wanneer deze kortingsbon automatisch wordt toegepast."
41
+
42
+ #: includes/wjecf-autocoupon.php:144
43
  msgid "Free shipping coupon"
44
  msgstr "Gratis verzending kortingsbon"
45
 
46
+ #: includes/wjecf-autocoupon.php:285
47
  #, php-format
48
  msgid "Discount applied: %s"
49
  msgstr "Korting toegepast: %s"
50
 
51
+ #: includes/wjecf-coupon-extensions.php:80
52
  msgid "Extended Coupon Features"
53
+ msgstr "Uitgebreide Kortingsbon Functies"
54
+
55
+ #: includes/wjecf-coupon-extensions.php:87
56
+ msgid "Do you find WooCommerce Extended Coupon Features useful?"
57
+ msgstr "Vindt u WooCommerce Extended Coupon Features handig?"
58
 
59
+ #: includes/wjecf-coupon-extensions.php:89
60
+ msgid "Express your gratitude"
61
+ msgstr "Toon uw waardering"
62
+
63
+ #: includes/wjecf-coupon-extensions.php:93
64
  msgid "Donate to the developer"
65
  msgstr "Doneer aan de ontwikkelaar"
66
 
67
+ #: includes/wjecf-coupon-extensions.php:105
68
+ msgid "Extended features"
69
+ msgstr "Uitgebreide functies"
70
+
71
+ #: includes/wjecf-coupon-extensions.php:124
72
  msgid "AND Products (not OR)"
73
  msgstr "ALLE Producten (niet OF)"
74
 
75
+ #: includes/wjecf-coupon-extensions.php:125
76
+ msgid ""
77
+ "Check this box if ALL of the products (see tab 'usage restriction') must be in the cart to "
78
+ "use this coupon (in stead of only one of the products)."
79
+ msgstr ""
80
+ "Aanvinken als ALLE producten (zie tab 'gebruiksbeperkingen') in de winkelwagen moeten zitten "
81
+ "om deze kortingsbon te kunnen gebruiken (in plaats van één van de producten)."
82
+
83
+ #: includes/wjecf-coupon-extensions.php:131
84
+ msgid "Minimum quantity of matching products"
85
+ msgstr "Minimum aantal overeengekomen producten"
86
+
87
+ #: includes/wjecf-coupon-extensions.php:132
88
+ msgid "No minimum"
89
+ msgstr "Geen minimum"
90
+
91
+ #: includes/wjecf-coupon-extensions.php:133
92
  msgid ""
93
+ "Minimum quantity of the products that match the given product or category restrictions (see "
94
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
95
+ "number of products is used."
96
  msgstr ""
97
+ "Minimum aantal producten wat aan de product- of categorierestricties voldoet (zie tab "
98
+ "'gebruiksbeperkingen'). Als geen product- of categorierestrictie is opgegeven worden alle "
99
+ "producten in de winkelwagen geteld."
100
 
101
+ #: includes/wjecf-coupon-extensions.php:141
102
+ msgid "Maximum quantity of matching products"
103
+ msgstr "Maximum aantal overeengekomen producten"
104
+
105
+ #: includes/wjecf-coupon-extensions.php:142
106
+ msgid "No maximum"
107
+ msgstr "Geen maximum"
108
+
109
+ #: includes/wjecf-coupon-extensions.php:143
110
+ msgid ""
111
+ "Maximum quantity of the products that match the given product or category restrictions (see "
112
+ "tab 'usage restriction'). If no product or category restrictions are specified, the total "
113
+ "number of products is used."
114
+ msgstr ""
115
+ "Maximum aantal producten wat aan de product- of categorierestricties voldoet (zie tab "
116
+ "'gebruiksbeperkingen'). Als geen product- of categorierestrictie is opgegeven worden alle "
117
+ "producten in de winkelwagen geteld."
118
+
119
+ #: includes/wjecf-coupon-extensions.php:150
120
  msgid "(AND)"
121
  msgstr "(ALLE)"
122
 
123
+ #: includes/wjecf-coupon-extensions.php:151
124
  msgid "(OR)"
125
  msgstr "(OF)"
126
 
127
+ #: includes/wjecf-coupon-extensions.php:171
128
  msgid "Shipping methods"
129
  msgstr "Verzendmethoden"
130
 
131
+ #: includes/wjecf-coupon-extensions.php:172
 
132
  msgid "Any shipping method"
133
  msgstr "Verzendmethoden"
134
 
135
+ #: includes/wjecf-coupon-extensions.php:181
136
+ msgid "One of these shipping methods must be selected in order for this coupon to be valid."
137
+ msgstr "Een van deze verzendmethoden moet gekozen zijn om deze kortingsbon te kunnen gebruiken."
 
 
 
 
138
 
139
+ #: includes/wjecf-coupon-extensions.php:187
140
  msgid "Payment methods"
141
  msgstr "Betaalmethoden"
142
 
143
+ #: includes/wjecf-coupon-extensions.php:188
144
+ msgid "Any payment method"
145
+ msgstr "Betaalmethoden"
146
+
147
+ #: includes/wjecf-coupon-extensions.php:199
148
+ msgid "One of these payment methods must be selected in order for this coupon to be valid."
149
+ msgstr "Een van deze betaalmethoden moet gekozen zijn om deze kortingsbon te kunnen gebruiken."
150
+
151
+ #: includes/wjecf-coupon-extensions.php:205
152
+ msgid "Customer restrictions"
153
+ msgstr "Klantbeperkingen"
154
+
155
+ #: includes/wjecf-coupon-extensions.php:206
156
  msgid ""
157
+ "If both a customer and a role restriction are supplied, matching either one of them will "
158
+ "suffice."
159
  msgstr ""
160
+ "Als zowel een klant- als klantrolrestrictie is opgegeven hoeft slechts aan één van de "
161
+ "restricties worden voldaan."
162
+
163
+ #: includes/wjecf-coupon-extensions.php:211
164
+ msgid "Allowed Customers"
165
+ msgstr "Toegestane klanten"
166
+
167
+ #: includes/wjecf-coupon-extensions.php:212
168
+ msgid "Any customer"
169
+ msgstr "Klanten"
170
+
171
+ #: includes/wjecf-coupon-extensions.php:225
172
+ msgid "Only these customers may use this coupon."
173
+ msgstr "Alleen deze klanten kunnen deze kortingsbon gebruiken."
174
+
175
+ #: includes/wjecf-coupon-extensions.php:232
176
+ msgid "Allowed User Roles"
177
+ msgstr "Toegestane klantrollen"
178
+
179
+ #: includes/wjecf-coupon-extensions.php:233 includes/wjecf-coupon-extensions.php:255
180
+ msgid "Any role"
181
+ msgstr "Klantrollen"
182
+
183
+ #: includes/wjecf-coupon-extensions.php:247
184
+ msgid "Only these User Roles may use this coupon."
185
+ msgstr "Alleen deze klantrollen kunnen deze kortingsbon gebruiken."
186
+
187
+ #: includes/wjecf-coupon-extensions.php:254
188
+ msgid "Disallowed User Roles"
189
+ msgstr "Uitgesloten klantrollen"
190
+
191
+ #: includes/wjecf-coupon-extensions.php:268
192
+ msgid "These User Roles will be specifically excluded from using this coupon."
193
+ msgstr "Deze klantrollen zijn uitgesloten om deze kortingsbon te gebruiken."
194
+
195
+ #~ msgid "Customers"
196
+ #~ msgstr "Klanten"
197
+
198
+ #~ msgid "Coupon only applies to these customers."
199
+ #~ msgstr "Kortingsbon is alleen geldig voor deze klanten."
200
+
201
+ #~ msgid "Customer roles"
202
+ #~ msgstr "Klantrollen"
203
+
204
+ #~ msgid "The customer must have one of these roles in order for this coupon to be valid."
205
+ #~ msgstr "Dat klant moet een van deze rollen hebben om de kortingsbon te kunnen gebruiken."
206
+
207
+ #~ msgid "Excluded customer roles"
208
+ #~ msgstr "Uitgesloten klantrollen"
209
+
210
+ #~ msgid "The customer must not have one of these roles in order for this coupon to be valid."
211
+ #~ msgstr "De klant mag geen van deze rollen hebben om de kortingsbon te kunnen gebruiken."
212
+
213
+ #~ msgid ""
214
+ #~ "Automatically add the coupon to the cart if the restrictions are met. Please enter a "
215
+ #~ "description when you check this box, the description will be shown in the customers cart "
216
+ #~ "if the coupon is applied."
217
+ #~ msgstr ""
218
+ #~ "Voeg de kortingsbon automatisch toe aan het winkelwagentje als aan alle voorwaarden wordt "
219
+ #~ "voldaan. Vult u a.u.b. een omschrijving in als u deze optie aanvinkt, de omschrijving zal "
220
+ #~ "aan de klant worden getoond wanneer de kortingsbon wordt toegevoegd."
221
+
222
+ #~ msgid ""
223
+ #~ "Check this box if ALL of the products (see above) must be in the cart to use this coupon "
224
+ #~ "(in stead of only one of the products)."
225
+ #~ msgstr ""
226
+ #~ "Aanvinken als ALLE producten (zie boven) in de winkelwagen moeten zitten om deze "
227
+ #~ "kortingsbon te kunnen gebruiken (in plaats van één van de producten)."
languages/woocommerce-jos-autocoupon.pot CHANGED
@@ -1,70 +1,184 @@
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Extended Coupon Features 2.00\n"
4
- "POT-Creation-Date: 2015-05-03 21:01+0100\n"
5
- "PO-Revision-Date: 2015-05-03 21:02+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Jos Koenis\n"
8
- "Language: EN\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.7\n"
13
  "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: C:\\lamp\\www\\qrvm_woo\\wp-content\\plugins"
17
- "\\woocommerce-auto-added-coupons\n"
18
 
19
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:49
20
  msgid "Auto coupon"
21
  msgstr ""
22
 
23
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:50
24
  msgid ""
25
  "Automatically add the coupon to the cart if the restrictions are met. Please "
26
  "enter a description when you check this box, the description will be shown "
27
- "in the customers cart if the coupon is applied."
28
  msgstr ""
29
 
30
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:111
 
 
 
 
 
 
 
 
31
  msgid "Free shipping coupon"
32
  msgstr ""
33
 
34
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-autocoupon.php:218
35
  #, php-format
36
  msgid "Discount applied: %s"
37
  msgstr ""
38
 
39
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:32
40
  msgid "Extended Coupon Features"
41
  msgstr ""
42
 
43
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:34
 
 
 
 
 
 
 
 
44
  msgid "Donate to the developer"
45
  msgstr ""
46
 
47
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  msgid "Shipping methods"
49
  msgstr ""
50
 
51
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:40
52
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:55
53
  msgid "Any shipping method"
54
  msgstr ""
55
 
56
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:49
57
  msgid ""
58
  "One of these shipping methods must be selected in order for this coupon to "
59
  "be valid."
60
  msgstr ""
61
 
62
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:54
63
  msgid "Payment methods"
64
  msgstr ""
65
 
66
- #: C:\lamp\www\qrvm_woo\wp-content\plugins\woocommerce-auto-added-coupons/includes/wjecf-coupon-extensions.php:64
 
 
 
 
67
  msgid ""
68
  "One of these payment methods must be selected in order for this coupon to be "
69
  "valid."
70
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: WooCommerce Extended Coupon Features 2.00\n"
5
+ "POT-Creation-Date: 2015-08-20 19:18+0100\n"
6
+ "PO-Revision-Date: 2015-05-09 18:12+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Jos Koenis\n"
9
+ "Language: en\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.1\n"
14
  "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: ..\\\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-SearchPath-0: .\n"
 
18
 
19
+ #: includes/wjecf-autocoupon.php:49 includes/wjecf-autocoupon.php:56
20
  msgid "Auto coupon"
21
  msgstr ""
22
 
23
+ #: includes/wjecf-autocoupon.php:57
24
  msgid ""
25
  "Automatically add the coupon to the cart if the restrictions are met. Please "
26
  "enter a description when you check this box, the description will be shown "
27
+ "in the customer's cart if the coupon is applied."
28
  msgstr ""
29
 
30
+ #: includes/wjecf-autocoupon.php:64
31
+ msgid "Apply silently"
32
+ msgstr ""
33
+
34
+ #: includes/wjecf-autocoupon.php:65
35
+ msgid "Don't display a message when this coupon is automatically applied."
36
+ msgstr ""
37
+
38
+ #: includes/wjecf-autocoupon.php:144
39
  msgid "Free shipping coupon"
40
  msgstr ""
41
 
42
+ #: includes/wjecf-autocoupon.php:285
43
  #, php-format
44
  msgid "Discount applied: %s"
45
  msgstr ""
46
 
47
+ #: includes/wjecf-coupon-extensions.php:80
48
  msgid "Extended Coupon Features"
49
  msgstr ""
50
 
51
+ #: includes/wjecf-coupon-extensions.php:87
52
+ msgid "Do you find WooCommerce Extended Coupon Features useful?"
53
+ msgstr ""
54
+
55
+ #: includes/wjecf-coupon-extensions.php:89
56
+ msgid "Express your gratitude"
57
+ msgstr ""
58
+
59
+ #: includes/wjecf-coupon-extensions.php:93
60
  msgid "Donate to the developer"
61
  msgstr ""
62
 
63
+ #: includes/wjecf-coupon-extensions.php:105
64
+ msgid "Extended features"
65
+ msgstr ""
66
+
67
+ #: includes/wjecf-coupon-extensions.php:124
68
+ msgid "AND Products (not OR)"
69
+ msgstr ""
70
+
71
+ #: includes/wjecf-coupon-extensions.php:125
72
+ msgid ""
73
+ "Check this box if ALL of the products (see tab 'usage restriction') must be "
74
+ "in the cart to use this coupon (in stead of only one of the products)."
75
+ msgstr ""
76
+
77
+ #: includes/wjecf-coupon-extensions.php:131
78
+ msgid "Minimum quantity of matching products"
79
+ msgstr ""
80
+
81
+ #: includes/wjecf-coupon-extensions.php:132
82
+ msgid "No minimum"
83
+ msgstr ""
84
+
85
+ #: includes/wjecf-coupon-extensions.php:133
86
+ msgid ""
87
+ "Minimum quantity of the products that match the given product or category "
88
+ "restrictions (see tab 'usage restriction'). If no product or category "
89
+ "restrictions are specified, the total number of products is used."
90
+ msgstr ""
91
+
92
+ #: includes/wjecf-coupon-extensions.php:141
93
+ msgid "Maximum quantity of matching products"
94
+ msgstr ""
95
+
96
+ #: includes/wjecf-coupon-extensions.php:142
97
+ msgid "No maximum"
98
+ msgstr ""
99
+
100
+ #: includes/wjecf-coupon-extensions.php:143
101
+ msgid ""
102
+ "Maximum quantity of the products that match the given product or category "
103
+ "restrictions (see tab 'usage restriction'). If no product or category "
104
+ "restrictions are specified, the total number of products is used."
105
+ msgstr ""
106
+
107
+ #: includes/wjecf-coupon-extensions.php:150
108
+ msgid "(AND)"
109
+ msgstr ""
110
+
111
+ #: includes/wjecf-coupon-extensions.php:151
112
+ msgid "(OR)"
113
+ msgstr ""
114
+
115
+ #: includes/wjecf-coupon-extensions.php:171
116
  msgid "Shipping methods"
117
  msgstr ""
118
 
119
+ #: includes/wjecf-coupon-extensions.php:172
 
120
  msgid "Any shipping method"
121
  msgstr ""
122
 
123
+ #: includes/wjecf-coupon-extensions.php:181
124
  msgid ""
125
  "One of these shipping methods must be selected in order for this coupon to "
126
  "be valid."
127
  msgstr ""
128
 
129
+ #: includes/wjecf-coupon-extensions.php:187
130
  msgid "Payment methods"
131
  msgstr ""
132
 
133
+ #: includes/wjecf-coupon-extensions.php:188
134
+ msgid "Any payment method"
135
+ msgstr ""
136
+
137
+ #: includes/wjecf-coupon-extensions.php:199
138
  msgid ""
139
  "One of these payment methods must be selected in order for this coupon to be "
140
  "valid."
141
  msgstr ""
142
+
143
+ #: includes/wjecf-coupon-extensions.php:205
144
+ msgid "Customer restrictions"
145
+ msgstr ""
146
+
147
+ #: includes/wjecf-coupon-extensions.php:206
148
+ msgid ""
149
+ "If both a customer and a role restriction are supplied, matching either one "
150
+ "of them will suffice."
151
+ msgstr ""
152
+
153
+ #: includes/wjecf-coupon-extensions.php:211
154
+ msgid "Allowed Customers"
155
+ msgstr ""
156
+
157
+ #: includes/wjecf-coupon-extensions.php:212
158
+ msgid "Any customer"
159
+ msgstr ""
160
+
161
+ #: includes/wjecf-coupon-extensions.php:225
162
+ msgid "Only these customers may use this coupon."
163
+ msgstr ""
164
+
165
+ #: includes/wjecf-coupon-extensions.php:232
166
+ msgid "Allowed User Roles"
167
+ msgstr ""
168
+
169
+ #: includes/wjecf-coupon-extensions.php:233
170
+ #: includes/wjecf-coupon-extensions.php:255
171
+ msgid "Any role"
172
+ msgstr ""
173
+
174
+ #: includes/wjecf-coupon-extensions.php:247
175
+ msgid "Only these User Roles may use this coupon."
176
+ msgstr ""
177
+
178
+ #: includes/wjecf-coupon-extensions.php:254
179
+ msgid "Disallowed User Roles"
180
+ msgstr ""
181
+
182
+ #: includes/wjecf-coupon-extensions.php:268
183
+ msgid "These User Roles will be specifically excluded from using this coupon."
184
+ msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: josk79
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Tags: woocommerce, coupons, discount
5
  Requires at least: 4.0.0
6
- Tested up to: 4.2.4
7
- Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -21,6 +21,8 @@ Very easy to use, the functionality is conveniently integrated to the WooCommerc
21
  * Restrict coupon by payment method,
22
  * Restrict coupon by a combination of products
23
 
 
 
24
  = Example: Auto coupon =
25
 
26
  Let the customer have a discount of $ 5.00 when the cart reaches $ 50.00.
@@ -42,7 +44,7 @@ Apply coupon through an url like this:
42
  Voila! Any coupon can be applied this way.
43
 
44
 
45
- This plugin has been tested with WordPress 4.2.4 and WooCommerce 2.4.1. Also in combination with WPML and qTranslate-X.
46
 
47
  == Installation ==
48
 
@@ -60,7 +62,7 @@ This plugin has been tested with WordPress 4.2.4 and WooCommerce 2.4.1. Also in
60
 
61
  = Is the plugin translatable? =
62
 
63
- Yes, all frontend string values are translatable with WPML. Translatable items appear in the context `woocommerce-jos-autocoupon` in "String Translations".
64
 
65
  = Why isn't my coupon applied using www.example.com?apply_coupon=my_coupon ? =
66
 
@@ -91,6 +93,25 @@ Sure! [This](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
91
  1. Simply use the WooCommerce Coupons menu to make a coupon an "auto coupon".
92
 
93
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  = 2.0.0 =
95
  * RENAME: Renamed plugin from "WooCommerce auto added coupons" to "WooCommerce Extended Coupon Features"
96
  * FEATURE: Restrict coupons by payment method
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Tags: woocommerce, coupons, discount
5
  Requires at least: 4.0.0
6
+ Tested up to: 4.3
7
+ Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
21
  * Restrict coupon by payment method,
22
  * Restrict coupon by a combination of products
23
 
24
+ For more information please visit [www.soft79.nl](http://www.soft79.nl)
25
+
26
  = Example: Auto coupon =
27
 
28
  Let the customer have a discount of $ 5.00 when the cart reaches $ 50.00.
44
  Voila! Any coupon can be applied this way.
45
 
46
 
47
+ This plugin has been tested with WordPress up to 4.3 and WooCommerce 2.4.6. Also in combination with WPML and qTranslate-X.
48
 
49
  == Installation ==
50
 
62
 
63
  = Is the plugin translatable? =
64
 
65
+ Yes, all string values are translatable through the supplied POT/PO/MO files. In WPML translatable items appear in the context `woocommerce-jos-autocoupon` in "String Translations".
66
 
67
  = Why isn't my coupon applied using www.example.com?apply_coupon=my_coupon ? =
68
 
93
  1. Simply use the WooCommerce Coupons menu to make a coupon an "auto coupon".
94
 
95
  == Changelog ==
96
+ = 2.2.1 =
97
+ * FIX: Prevent mulitple apply_coupon calls (for example through ajax)
98
+ * FIX: Don't redirect to cart when using WooCommerce's ?add-to-cart=xxx in combination with ?apply_coupon=xxx as this would prevent the application of the coupon.
99
+
100
+ = 2.2.0 =
101
+ * FIX: Lowered execution priority for apply_coupon by url for combinations with add-to-cart.
102
+ * FEATURE: New coupon feature: Excluded customer role restriction
103
+ * FEATURE: New coupon feature: Customer / customer role restriction
104
+ * FEATURE: New coupon feature: Minimum / maximum quantity of matching products in the cart
105
+ * FEATURE: New coupon feature: Allow auto coupons to be applied silently (without displaying a message)
106
+ * TWEAK: Moved all settings to the 'Extended features'-tab on the admin page.
107
+ * FIX: 2.0.0 broke compatibility with PHP versions older than 5.3
108
+ * FIX: Changed method to fetch email addresses for auto coupon with email address restriction
109
+ * FILTER: Filter wjecf_coupon_has_a_value (An auto coupon will not be applied if this returns false)
110
+ * FILTER: Filter wjecf_coupon_can_be_applied (An auto coupon will not be applied if this returns false)
111
+ * INTERNAL: db_version tracking for automatic updates
112
+ * INTERNAL: Consistent use of wjecf prefix.
113
+ * INTERNAL: Renamed meta_key woocommerce-jos-autocoupon to _wjecf_is_auto_coupon
114
+
115
  = 2.0.0 =
116
  * RENAME: Renamed plugin from "WooCommerce auto added coupons" to "WooCommerce Extended Coupon Features"
117
  * FEATURE: Restrict coupons by payment method
woocommerce-jos-autocoupon.php CHANGED
@@ -1,45 +1,15 @@
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Extended Coupon Features
4
- * Plugin URI: http://wordpress.org/plugins/woocommerce-auto-added-coupons
5
  * Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
6
- * Version: 2.0.0
7
  * Author: Jos Koenis
8
  * License: GPL2
9
  */
10
 
11
- /*
12
- Change history:
13
- 2.0.0:
14
- - RENAME: Renamed plugin from "WooCommerce auto added coupons" to "WooCommerce Extended Coupon Features"
15
- - FEATURE: Restrict coupons by payment method
16
- - FEATURE: Restrict coupons by shipping method
17
- - FEATURE: Use AND-operator for the selected products (default is OR)
18
- - FIX: Validate email restrictions for auto coupons
19
- - Norwegian translation added (Thanks to Anders Zorensen)
20
- 1.1.5:
21
- - FIX: Cart total discount amount showing wrong discount value in newer WooCommerce versions (tax)
22
- - Performance: get_all_auto_coupons select only where meta woocommerce_jos_autocoupon = yes
23
- 1.1.4:
24
- - Translation support through .mo / .po files
25
- - Included translations: Dutch, German, Spanish (Thanks to stephan.sperling for the german translation)
26
- 1.1.3.1:
27
- - FIX: Apply auto coupon if discount is 0.00 and free shipping is ticked
28
- 1.1.3:
29
- - Don't apply an auto coupon if the discount is 0.00
30
- - Allow applying multiple coupons via an url using *?apply_coupon=coupon_code1,coupon_code2
31
- 1.1.2:
32
- - Minor change to make the plugin compatible with WooCommerce 2.3.1
33
- - Loop through coupons in ascending order
34
- 1.1.1:
35
- - Tested with Wordpress 4.0
36
- 1.1.0:
37
- - Allow applying coupon via an url using *?apply_coupon=coupon_code*
38
- 1.0.1:
39
- - Don't apply an autocoupon if the coupon is for individual_use and another coupon is already applied.
40
-
41
-
42
- */
43
 
44
  defined('ABSPATH') or die();
45
 
@@ -51,26 +21,29 @@ require_once( 'includes/wjecf-coupon-extensions.php' );
51
  **/
52
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
53
 
54
- add_action('plugins_loaded', function() {
55
- load_plugin_textdomain('woocommerce-jos-autocoupon', false, basename(dirname(__FILE__)) . '/languages/' );
56
- } );
 
 
 
57
 
58
- $wjce_extended_coupon_features = new WC_Jos_Extended_Coupon_Features_Controller();
59
- $wjce_autocoupon = new WC_Jos_AutoCoupon_Controller();
60
 
61
  }
62
 
63
  /**
64
  * Add donate-link to plugin page
65
  */
66
- if ( ! function_exists( 'woocommerce_jos_autocoupon_plugin_meta' ) ) {
67
- function woocommerce_jos_autocoupon_plugin_meta( $links, $file ) {
68
  if ( strpos( $file, 'woocommerce-jos-autocoupon.php' ) !== false ) {
69
  $links = array_merge( $links, array( '<a href="' . WC_Jos_Extended_Coupon_Features_Controller::get_donate_url() . '" title="Support the development" target="_blank">Donate</a>' ) );
70
  }
71
  return $links;
72
  }
73
- add_filter( 'plugin_row_meta', 'woocommerce_jos_autocoupon_plugin_meta', 10, 2 );
74
  }
75
 
76
 
@@ -100,7 +73,7 @@ add_action( 'woocommerce_review_order_after_submit' , function () {
100
  jQuery(document).ready(function($){
101
  $(document.body).on('change', 'input[name="payment_method"]', function() {
102
  $('body').trigger('update_checkout');
103
- $.ajax( $fragment_refresh );
104
  });
105
  });
106
  </script><?php
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Extended Coupon Features
4
+ * Plugin URI: http://www.soft79.nl
5
  * Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
6
+ * Version: 2.2.1
7
  * Author: Jos Koenis
8
  * License: GPL2
9
  */
10
 
11
+ // Change history: see readme.txt
12
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  defined('ABSPATH') or die();
15
 
21
  **/
22
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
23
 
24
+ if ( ! function_exists( 'wjecf_load_plugin_textdomain' ) ) {
25
+ function wjecf_load_plugin_textdomain() {
26
+ load_plugin_textdomain('woocommerce-jos-autocoupon', false, basename(dirname(__FILE__)) . '/languages/' );
27
+ }
28
+ add_action('plugins_loaded', 'wjecf_load_plugin_textdomain');
29
+ }
30
 
31
+ $wjecf_extended_coupon_features = new WC_Jos_Extended_Coupon_Features_Controller();
32
+ $wjecf_autocoupon = new WC_Jos_AutoCoupon_Controller();
33
 
34
  }
35
 
36
  /**
37
  * Add donate-link to plugin page
38
  */
39
+ if ( ! function_exists( 'wjecf_plugin_meta' ) ) {
40
+ function wjecf_plugin_meta( $links, $file ) {
41
  if ( strpos( $file, 'woocommerce-jos-autocoupon.php' ) !== false ) {
42
  $links = array_merge( $links, array( '<a href="' . WC_Jos_Extended_Coupon_Features_Controller::get_donate_url() . '" title="Support the development" target="_blank">Donate</a>' ) );
43
  }
44
  return $links;
45
  }
46
+ add_filter( 'plugin_row_meta', 'wjecf_plugin_meta', 10, 2 );
47
  }
48
 
49
 
73
  jQuery(document).ready(function($){
74
  $(document.body).on('change', 'input[name="payment_method"]', function() {
75
  $('body').trigger('update_checkout');
76
+ //$.ajax( $fragment_refresh );
77
  });
78
  });
79
  </script><?php