WooCommerce Advanced Free Shipping - Version 1.0.6

Version Description

  • 04-06-2015 =

  • [Add] - Escaping/sanitizing to different elements

  • Improvement - Shipping class matching function now uses varation shiping class instead of the parents'

  • [i18n] - Add Italian translation

Download this release

Release Info

Developer sormano
Plugin Icon 128x128 WooCommerce Advanced Free Shipping
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

includes/admin/settings/conditions/class-wafs-condition.php CHANGED
@@ -14,6 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
  class WAFS_Condition {
16
 
 
17
  /**
18
  * Condition.
19
  *
@@ -23,6 +24,7 @@ class WAFS_Condition {
23
  */
24
  public $condition;
25
 
 
26
  /**
27
  * Operator.
28
  *
@@ -32,6 +34,7 @@ class WAFS_Condition {
32
  */
33
  public $operator;
34
 
 
35
  /**
36
  * Value.
37
  *
@@ -41,6 +44,7 @@ class WAFS_Condition {
41
  */
42
  public $value;
43
 
 
44
  /**
45
  * Group ID.
46
  *
@@ -50,6 +54,7 @@ class WAFS_Condition {
50
  */
51
  public $group;
52
 
 
53
  /**
54
  * Condition id.
55
  *
@@ -161,7 +166,7 @@ class WAFS_Condition {
161
  */
162
  public function wafs_add_condition_button() {
163
  ?>
164
- <a class='button condition-add' data-group='<?php echo $this->group; ?>' href='javascript:void(0);'>+</a>
165
  <?php
166
  }
167
 
14
 
15
  class WAFS_Condition {
16
 
17
+
18
  /**
19
  * Condition.
20
  *
24
  */
25
  public $condition;
26
 
27
+
28
  /**
29
  * Operator.
30
  *
34
  */
35
  public $operator;
36
 
37
+
38
  /**
39
  * Value.
40
  *
44
  */
45
  public $value;
46
 
47
+
48
  /**
49
  * Group ID.
50
  *
54
  */
55
  public $group;
56
 
57
+
58
  /**
59
  * Condition id.
60
  *
166
  */
167
  public function wafs_add_condition_button() {
168
  ?>
169
+ <a class='button condition-add' data-group='<?php echo absint( $this->group ); ?>' href='javascript:void(0);'>+</a>
170
  <?php
171
  }
172
 
includes/admin/settings/conditions/condition-conditions.php CHANGED
@@ -44,20 +44,18 @@ function wafs_condition_conditions( $id, $group = 0, $current_value = 'subtotal'
44
 
45
  $conditions = apply_filters( 'wafs_conditions', $conditions );
46
 
47
- ?><span class='wafs-condition-wrap wafs-condition-wrap-<?php echo $id; ?>'>
48
 
49
- <select class='wafs-condition' data-group='<?php echo $group; ?>' data-id='<?php echo $id; ?>'
50
- name='_wafs_shipping_method_conditions[<?php echo $group; ?>][<?php echo $id; ?>][condition]'><?php
51
 
52
  foreach ( $conditions as $option_group => $values ) :
53
 
54
- ?><optgroup label='<?php echo $option_group; ?>'><?php
55
 
56
- foreach ( $values as $key => $value ) :
57
-
58
- ?><option value='<?php echo $key; ?>' <?php selected( $key, $current_value ); ?>><?php echo $value; ?></option><?php
59
-
60
- endforeach;
61
 
62
  ?></optgroup><?php
63
 
44
 
45
  $conditions = apply_filters( 'wafs_conditions', $conditions );
46
 
47
+ ?><span class='wafs-condition-wrap wafs-condition-wrap-<?php echo absint( $id ); ?>'>
48
 
49
+ <select class='wafs-condition' data-group='<?php echo absint( $group ); ?>' data-id='<?php echo absint( $id ); ?>'
50
+ name='_wafs_shipping_method_conditions[<?php echo absint( $group ); ?>][<?php echo absint( $id ); ?>][condition]'><?php
51
 
52
  foreach ( $conditions as $option_group => $values ) :
53
 
54
+ ?><optgroup label='<?php echo esc_attr( $option_group ); ?>'><?php
55
 
56
+ foreach ( $values as $key => $value ) :
57
+ ?><option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $current_value ); ?>><?php echo esc_html( $value ); ?></option><?php
58
+ endforeach;
 
 
59
 
60
  ?></optgroup><?php
61
 
includes/admin/settings/conditions/condition-descriptions.php CHANGED
@@ -32,14 +32,14 @@ function wafs_condition_description( $condition ) {
32
  return;
33
  endif;
34
 
35
- ?><span class='wafs-description <?php echo $condition; ?>-description'>
36
 
37
  <div class='description'>
38
 
39
  <img class='wafs_tip' src='<?php echo WC()->plugin_url(); ?>/assets/images/help.png' height='24' width='24' />
40
 
41
  <div class='wafs_desc'><?php
42
- echo $descriptions[ $condition ];
43
  ?></div>
44
 
45
  </div>
32
  return;
33
  endif;
34
 
35
+ ?><span class='wafs-description <?php echo sanitize_html_class( $condition ); ?>-description'>
36
 
37
  <div class='description'>
38
 
39
  <img class='wafs_tip' src='<?php echo WC()->plugin_url(); ?>/assets/images/help.png' height='24' width='24' />
40
 
41
  <div class='wafs_desc'><?php
42
+ echo esc_html( $descriptions[ $condition ] );
43
  ?></div>
44
 
45
  </div>
includes/admin/settings/conditions/condition-operators.php CHANGED
@@ -23,13 +23,13 @@ function wafs_condition_operator( $id, $group = 0, $current_value = '==' ) {
23
 
24
  $operators = apply_filters( 'wafs_operators', $operators );
25
 
26
- ?><span class='wafs-operator-wrap wafs-operator-wrap-<?php echo $id; ?>'>
27
 
28
- <select id='' class='wafs-operator' name='_wafs_shipping_method_conditions[<?php echo $group; ?>][<?php echo $id; ?>][operator]'>
29
 
30
  <?php foreach ( $operators as $key => $value ) :
31
 
32
- ?><option value='<?php echo $key; ?>' <?php selected( $key, $current_value ); ?>><?php echo $value; ?></option><?php
33
 
34
  endforeach; ?>
35
 
23
 
24
  $operators = apply_filters( 'wafs_operators', $operators );
25
 
26
+ ?><span class='wafs-operator-wrap wafs-operator-wrap-<?php echo absint( $id ); ?>'>
27
 
28
+ <select id='' class='wafs-operator' name='_wafs_shipping_method_conditions[<?php echo absint( $group ); ?>][<?php echo absint( $id ); ?>][operator]'>
29
 
30
  <?php foreach ( $operators as $key => $value ) :
31
 
32
+ ?><option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $current_value ); ?>><?php echo esc_html( $value ); ?></option><?php
33
 
34
  endforeach; ?>
35
 
includes/admin/settings/conditions/condition-values.php CHANGED
@@ -71,11 +71,11 @@ function wafs_condition_values( $id, $group = 0, $condition = 'subtotal', $curre
71
  case 'contains_shipping_class' :
72
 
73
  $values['field'] = 'select';
74
- $values['options']['-1'] = __( 'No shipping class', 'woocommerce' );
75
 
76
  // Get all shipping classes
77
  foreach ( get_terms( 'product_shipping_class', array( 'hide_empty' => false ) ) as $shipping_class ) :
78
- $values['options'][ $shipping_class->slug ] = $shipping_class->name;
79
  endforeach;
80
 
81
  break;
@@ -186,22 +186,22 @@ function wafs_condition_values( $id, $group = 0, $condition = 'subtotal', $curre
186
 
187
  $values = apply_filters( 'wafs_values', $values, $condition );
188
 
189
- ?><span class='wafs-value-wrap wafs-value-wrap-<?php echo $id; ?>'><?php
190
 
191
  switch ( $values['field'] ) :
192
 
193
  case 'text' :
194
 
195
- ?><input type='text' class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo $group; ?>][<?php echo $id; ?>][value]'
196
- placeholder='<?php echo @$values['placeholder']; ?>' value='<?php echo $current_value; ?>'><?php
197
 
198
  break;
199
 
200
  case 'number' :
201
 
202
- ?><input type='text' class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo $group; ?>][<?php echo $id; ?>][value]'
203
- min='<?php echo @$values['min']; ?>' max='<?php echo @$values['max']; ?>' placeholder='<?php echo @$values['placeholder']; ?>'
204
- value='<?php echo $current_value; ?>'><?php
205
 
206
  break;
207
 
@@ -209,17 +209,17 @@ function wafs_condition_values( $id, $group = 0, $condition = 'subtotal', $curre
209
 
210
  // Backwards compatibility for extensions
211
  @array_merge( $values['options'], $values['values'] );
212
- ?><select class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo $group; ?>][<?php echo $id; ?>][value]'>
213
 
214
  <option <?php selected( '', $current_value ); ?>><?php _e( 'Select option' , 'woocommerce-advanced-free-shipping' ); ?></option><?php
215
  foreach ( $values['options'] as $key => $value ) :
216
 
217
  if ( ! is_array( $value ) ) :
218
- ?><option value='<?php echo $key; ?>' <?php selected( $key, $current_value ); ?>><?php echo $value; ?></option><?php
219
  else :
220
  ?><optgroup label='<?php echo $key ?>'><?php
221
  foreach ( $value as $k => $v ) :
222
- ?><option value='<?php echo $k; ?>' <?php selected( $k, $current_value ); ?>><?php echo $v; ?></option><?php
223
  endforeach;
224
  ?></optgroup><?php
225
 
71
  case 'contains_shipping_class' :
72
 
73
  $values['field'] = 'select';
74
+ $values['options'][''] = __( 'No shipping class', 'woocommerce' );
75
 
76
  // Get all shipping classes
77
  foreach ( get_terms( 'product_shipping_class', array( 'hide_empty' => false ) ) as $shipping_class ) :
78
+ $values['options'][ $shipping_class->slug ] = $shipping_class->name;
79
  endforeach;
80
 
81
  break;
186
 
187
  $values = apply_filters( 'wafs_values', $values, $condition );
188
 
189
+ ?><span class='wafs-value-wrap wafs-value-wrap-<?php echo absint( $id ); ?>'><?php
190
 
191
  switch ( $values['field'] ) :
192
 
193
  case 'text' :
194
 
195
+ ?><input type='text' class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo absint( $group ); ?>][<?php echo absint( $id ); ?>][value]'
196
+ placeholder='<?php echo esc_attr( @$values['placeholder'] ); ?>' value='<?php echo esc_attr( $current_value ); ?>'><?php
197
 
198
  break;
199
 
200
  case 'number' :
201
 
202
+ ?><input type='text' class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo absint( $group ); ?>][<?php echo absint( $id ); ?>][value]'
203
+ min='<?php echo esc_attr( @$values['min'] ); ?>' max='<?php echo esc_attr( @$values['max'] ); ?>' placeholder='<?php echo esc_attr( @$values['placeholder'] ); ?>'
204
+ value='<?php echo esc_attr( $current_value ); ?>'><?php
205
 
206
  break;
207
 
209
 
210
  // Backwards compatibility for extensions
211
  @array_merge( $values['options'], $values['values'] );
212
+ ?><select class='wafs-value' name='_wafs_shipping_method_conditions[<?php echo absint( $group ); ?>][<?php echo absint( $id ); ?>][value]'>
213
 
214
  <option <?php selected( '', $current_value ); ?>><?php _e( 'Select option' , 'woocommerce-advanced-free-shipping' ); ?></option><?php
215
  foreach ( $values['options'] as $key => $value ) :
216
 
217
  if ( ! is_array( $value ) ) :
218
+ ?><option value='<?php echo esc_attr( $key ); ?>' <?php selected( $key, $current_value ); ?>><?php echo esc_html( $value ); ?></option><?php
219
  else :
220
  ?><optgroup label='<?php echo $key ?>'><?php
221
  foreach ( $value as $k => $v ) :
222
+ ?><option value='<?php echo esc_attr( $k ); ?>' <?php selected( $k, $current_value ); ?>><?php echo esc_html( $v ); ?></option><?php
223
  endforeach;
224
  ?></optgroup><?php
225
 
includes/admin/settings/meta-box-conditions.php CHANGED
@@ -24,7 +24,7 @@ $conditions = get_post_meta( $post->ID, '_wafs_shipping_method_conditions', true
24
 
25
  foreach ( $conditions as $condition_group => $conditions ) :
26
 
27
- ?><div class='condition-group condition-group-<?php echo $condition_group; ?>' data-group='<?php echo $condition_group; ?>'>
28
 
29
  <p class='or_match'>
30
  <?php _e( 'Or match all of the following rules to allow free shipping:', 'woocommerce-advanced-free-shipping' );?>
@@ -45,7 +45,7 @@ $conditions = get_post_meta( $post->ID, '_wafs_shipping_method_conditions', true
45
  else :
46
 
47
  ?><div class='condition-group condition-group-0' data-group='0'><?php
48
- new Wafs_Condition();
49
  ?></div><?php
50
 
51
  endif;
24
 
25
  foreach ( $conditions as $condition_group => $conditions ) :
26
 
27
+ ?><div class='condition-group condition-group-<?php echo absint( $condition_group ); ?>' data-group='<?php echo absint( $condition_group ); ?>'>
28
 
29
  <p class='or_match'>
30
  <?php _e( 'Or match all of the following rules to allow free shipping:', 'woocommerce-advanced-free-shipping' );?>
45
  else :
46
 
47
  ?><div class='condition-group condition-group-0' data-group='0'><?php
48
+ new Wafs_Condition();
49
  ?></div><?php
50
 
51
  endif;
includes/admin/settings/meta-box-settings.php CHANGED
@@ -15,6 +15,7 @@ wp_nonce_field( 'wafs_settings_meta_box', 'wafs_settings_meta_box_nonce' );
15
 
16
  global $post;
17
  $settings = get_post_meta( $post->ID, '_wafs_shipping_method', true );
 
18
 
19
  ?><div class='wafs wafs_settings wafs_meta_box wafs_settings_meta_box'>
20
 
@@ -22,7 +23,7 @@ $settings = get_post_meta( $post->ID, '_wafs_shipping_method', true );
22
 
23
  <label for='shipping_title'><?php _e( 'Shipping title', 'woocommerce-advanced-free-shipping' ); ?></label>
24
  <input type='text' class='' id='shipping_title' name='_wafs_shipping_method[shipping_title]'
25
- value='<?php echo @$settings['shipping_title']; ?>' placeholder='<?php _e( 'e.g. Free Shipping', 'woocommerce-advanced-free-shipping' ); ?>'>
26
 
27
  </p>
28
 
15
 
16
  global $post;
17
  $settings = get_post_meta( $post->ID, '_wafs_shipping_method', true );
18
+ $settings['shipping_title'] = ! empty( $settings['shipping_title'] ) ? $settings['shipping_title'] : '';
19
 
20
  ?><div class='wafs wafs_settings wafs_meta_box wafs_settings_meta_box'>
21
 
23
 
24
  <label for='shipping_title'><?php _e( 'Shipping title', 'woocommerce-advanced-free-shipping' ); ?></label>
25
  <input type='text' class='' id='shipping_title' name='_wafs_shipping_method[shipping_title]'
26
+ value='<?php echo esc_attr( $settings['shipping_title'] ); ?>' placeholder='<?php _e( 'e.g. Free Shipping', 'woocommerce-advanced-free-shipping' ); ?>'>
27
 
28
  </p>
29
 
includes/admin/views/conditions-table.php CHANGED
@@ -41,7 +41,7 @@ $method_conditions = get_posts( array( 'posts_per_page' => '-1', 'post_type' =>
41
  <td>
42
  <strong>
43
  <a href='<?php echo get_edit_post_link( $method_condition->ID ); ?>' class='row-title' title='<?php _e( 'Edit Method', 'woocommerce-advanced-free-shipping' ); ?>'>
44
- <?php echo $method_condition->post_title; echo empty( $method_condition->post_title) ? __( 'Untitled', 'woocommerce-advanced-free-shipping' ) : null; ?>
45
  </a>
46
  </strong>
47
  <div class='row-actions'>
@@ -52,13 +52,13 @@ $method_conditions = get_posts( array( 'posts_per_page' => '-1', 'post_type' =>
52
  |
53
  </span>
54
  <span class='trash'>
55
- <a href='<?php echo get_delete_post_link( $method_condition->ID ); ?>' title='<?php _e( 'Delete Method', 'woocommerce-advanced-free-shipping' ); ?>'>
56
- <?php _e( 'Delete', 'woocommerce-advanced-free-shipping' ); ?>
57
- </a>
58
  </span>
59
  </div>
60
  </td>
61
- <td><?php echo empty( $method_details['shipping_title'] ) ? __( 'Free Shipping', 'woocommerce-advanced-free-shipping') : $method_details['shipping_title']; ?></td>
62
  <td><?php echo count( $conditions ); ?></td>
63
  </td>
64
  </tr><?php
41
  <td>
42
  <strong>
43
  <a href='<?php echo get_edit_post_link( $method_condition->ID ); ?>' class='row-title' title='<?php _e( 'Edit Method', 'woocommerce-advanced-free-shipping' ); ?>'>
44
+ <?php echo empty( $method_condition->post_title) ? __( 'Untitled', 'woocommerce-advanced-free-shipping' ) : esc_html( $method_condition->post_title ); ?>
45
  </a>
46
  </strong>
47
  <div class='row-actions'>
52
  |
53
  </span>
54
  <span class='trash'>
55
+ <a href='<?php echo get_delete_post_link( $method_condition->ID ); ?>' title='<?php _e( 'Delete Method', 'woocommerce-advanced-free-shipping' ); ?>'><?php
56
+ _e( 'Delete', 'woocommerce-advanced-free-shipping' );
57
+ ?></a>
58
  </span>
59
  </div>
60
  </td>
61
+ <td><?php echo empty( $method_details['shipping_title'] ) ? __( 'Free Shipping', 'woocommerce-advanced-free-shipping') : esc_html( $method_details['shipping_title'] ); ?></td>
62
  <td><?php echo count( $conditions ); ?></td>
63
  </td>
64
  </tr><?php
includes/class-wafs-ajax.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  /**
4
- * Class Wafs_post_type
5
  *
6
- * Initialize the WAFS post type
7
  *
8
  * @class WAFS_Ajax
9
  * @author Jeroen Sormani
@@ -57,7 +57,7 @@ class WAFS_Ajax {
57
  */
58
  public function wafs_add_condition_group() {
59
 
60
- ?><div class='condition-group condition-group-<?php echo $_POST['group']; ?>' data-group='<?php echo $_POST['group']; ?>'>
61
 
62
  <p class='or_match'><?php _e( 'Or match all of the following rules to allow free shipping:', 'woocommerce-advanced-free-shipping' );?></p><?php
63
 
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  /**
4
+ * Class Wafs_post_type.
5
  *
6
+ * Initialize the WAFS post type.
7
  *
8
  * @class WAFS_Ajax
9
  * @author Jeroen Sormani
57
  */
58
  public function wafs_add_condition_group() {
59
 
60
+ ?><div class='condition-group condition-group-<?php echo absint( $_POST['group'] ); ?>' data-group='<?php echo absint( $_POST['group'] ); ?>'>
61
 
62
  <p class='or_match'><?php _e( 'Or match all of the following rules to allow free shipping:', 'woocommerce-advanced-free-shipping' );?></p><?php
63
 
includes/class-wafs-match-conditions.php CHANGED
@@ -59,7 +59,7 @@ class WAFS_Match_Conditions {
59
  */
60
  public function wafs_match_condition_subtotal( $match, $operator, $value ) {
61
 
62
- if ( ! isset( WC()->cart ) ) return;
63
 
64
  if ( '==' == $operator ) :
65
  $match = ( WC()->cart->subtotal == $value );
@@ -90,7 +90,7 @@ class WAFS_Match_Conditions {
90
  */
91
  public function wafs_match_condition_subtotal_ex_tax( $match, $operator, $value ) {
92
 
93
- if ( ! isset( WC()->cart ) ) return;
94
 
95
  if ( '==' == $operator ) :
96
  $match = ( WC()->cart->subtotal_ex_tax == $value );
@@ -121,7 +121,7 @@ class WAFS_Match_Conditions {
121
  */
122
  public function wafs_match_condition_tax( $match, $operator, $value ) {
123
 
124
- if ( ! isset( WC()->cart ) ) return;
125
 
126
  $taxes = array_sum( (array) WC()->cart->taxes );
127
 
@@ -155,7 +155,7 @@ class WAFS_Match_Conditions {
155
  */
156
  public function wafs_match_condition_quantity( $match, $operator, $value ) {
157
 
158
- if ( ! isset( WC()->cart ) ) return;
159
 
160
  if ( '==' == $operator ) :
161
  $match = ( WC()->cart->cart_contents_count == $value );
@@ -186,7 +186,7 @@ class WAFS_Match_Conditions {
186
  */
187
  public function wafs_match_condition_contains_product( $match, $operator, $value ) {
188
 
189
- if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return;
190
 
191
  foreach ( WC()->cart->cart_contents as $product ) :
192
  $product_ids[] = $product['product_id'];
@@ -217,7 +217,7 @@ class WAFS_Match_Conditions {
217
  */
218
  public function wafs_match_condition_coupon( $match, $operator, $value ) {
219
 
220
- if ( ! isset( WC()->cart ) ) return;
221
 
222
  if ( '==' == $operator ) :
223
  $match = ( in_array( $value, WC()->cart->applied_coupons ) );
@@ -244,7 +244,7 @@ class WAFS_Match_Conditions {
244
  */
245
  public function wafs_match_condition_weight( $match, $operator, $value ) {
246
 
247
- if ( ! isset( WC()->cart ) ) return;
248
 
249
  if ( '==' == $operator ) :
250
  $match = ( WC()->cart->cart_contents_weight == $value );
@@ -274,7 +274,7 @@ class WAFS_Match_Conditions {
274
  * @return BOOL Matching result, TRUE if results match, otherwise FALSE. */
275
  public function wafs_match_condition_contains_shipping_class( $match, $operator, $value ) {
276
 
277
- if ( ! isset( WC()->cart ) ) return;
278
 
279
  if ( $operator == '!=' ) :
280
  // True until proven false
@@ -283,7 +283,8 @@ class WAFS_Match_Conditions {
283
 
284
  foreach ( WC()->cart->cart_contents as $product ) :
285
 
286
- $product = get_product( $product['product_id'] );
 
287
 
288
  if ( $operator == '==' ) :
289
  if ( $product->get_shipping_class() == $value ) :
@@ -321,7 +322,7 @@ class WAFS_Match_Conditions {
321
  */
322
  public function wafs_match_condition_zipcode( $match, $operator, $value ) {
323
 
324
- if ( ! isset( WC()->customer ) ) return;
325
 
326
  if ( '==' == $operator ) :
327
 
@@ -364,7 +365,7 @@ class WAFS_Match_Conditions {
364
  */
365
  public function wafs_match_condition_city( $match, $operator, $value ) {
366
 
367
- if ( ! isset( WC()->customer ) ) return;
368
 
369
  if ( '==' == $operator ) :
370
  $match = ( preg_match( "/^$value$/i", WC()->customer->get_shipping_city() ) );
@@ -388,10 +389,10 @@ class WAFS_Match_Conditions {
388
  * @param string $operator Operator selected by the user in the condition row.
389
  * @param mixed $value Value given by the user in the condition row.
390
  * @return BOOL Matching result, TRUE if results match, otherwise FALSE.
391
- True if this condition matches, false if condition doesn't match. */
392
  public function wafs_match_condition_state( $match, $operator, $value ) {
393
 
394
- if ( ! isset( WC()->customer ) ) return;
395
 
396
  $state = WC()->customer->get_shipping_country() . '_' . WC()->customer->get_shipping_state();
397
 
@@ -420,7 +421,7 @@ class WAFS_Match_Conditions {
420
  */
421
  public function wafs_match_condition_country( $match, $operator, $value ) {
422
 
423
- if ( ! isset( WC()->customer ) ) return;
424
 
425
  if ( '==' == $operator ) :
426
  $match = ( preg_match( "/^$value$/i", WC()->customer->get_shipping_country() ) );
@@ -480,7 +481,7 @@ class WAFS_Match_Conditions {
480
  */
481
  public function wafs_match_condition_width( $match, $operator, $value ) {
482
 
483
- if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return;
484
 
485
  foreach ( WC()->cart->cart_contents as $product ) :
486
 
@@ -523,7 +524,7 @@ class WAFS_Match_Conditions {
523
  */
524
  public function wafs_match_condition_height( $match, $operator, $value ) {
525
 
526
- if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return;
527
 
528
  foreach ( WC()->cart->cart_contents as $product ) :
529
 
@@ -566,7 +567,7 @@ class WAFS_Match_Conditions {
566
  */
567
  public function wafs_match_condition_length( $match, $operator, $value ) {
568
 
569
- if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return;
570
 
571
  foreach ( WC()->cart->cart_contents as $product ) :
572
 
@@ -609,15 +610,12 @@ class WAFS_Match_Conditions {
609
  */
610
  public function wafs_match_condition_stock( $match, $operator, $value ) {
611
 
612
- if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return;
613
 
614
  foreach ( WC()->cart->cart_contents as $product ) :
615
 
616
- if ( true == $product['data']->variation_has_stock ) :
617
- $stock[] = ( get_post_meta( $product['data']->variation_id, '_stock', true ) );
618
- else :
619
- $stock[] = ( get_post_meta( $product['product_id'], '_stock', true ) );
620
- endif;
621
 
622
  endforeach;
623
 
@@ -652,7 +650,7 @@ class WAFS_Match_Conditions {
652
  */
653
  public function wafs_match_condition_stock_status( $match, $operator, $value ) {
654
 
655
- if ( ! isset( WC()->cart ) ) return;
656
 
657
  if ( '==' == $operator ) :
658
 
@@ -692,7 +690,7 @@ class WAFS_Match_Conditions {
692
  */
693
  public function wafs_match_condition_category( $match, $operator, $value ) {
694
 
695
- if ( ! isset( WC()->cart ) ) return;
696
 
697
  $match = true;
698
 
59
  */
60
  public function wafs_match_condition_subtotal( $match, $operator, $value ) {
61
 
62
+ if ( ! isset( WC()->cart ) ) return $match;
63
 
64
  if ( '==' == $operator ) :
65
  $match = ( WC()->cart->subtotal == $value );
90
  */
91
  public function wafs_match_condition_subtotal_ex_tax( $match, $operator, $value ) {
92
 
93
+ if ( ! isset( WC()->cart ) ) return $match;
94
 
95
  if ( '==' == $operator ) :
96
  $match = ( WC()->cart->subtotal_ex_tax == $value );
121
  */
122
  public function wafs_match_condition_tax( $match, $operator, $value ) {
123
 
124
+ if ( ! isset( WC()->cart ) ) return $match;
125
 
126
  $taxes = array_sum( (array) WC()->cart->taxes );
127
 
155
  */
156
  public function wafs_match_condition_quantity( $match, $operator, $value ) {
157
 
158
+ if ( ! isset( WC()->cart ) ) return $match;
159
 
160
  if ( '==' == $operator ) :
161
  $match = ( WC()->cart->cart_contents_count == $value );
186
  */
187
  public function wafs_match_condition_contains_product( $match, $operator, $value ) {
188
 
189
+ if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return $match;
190
 
191
  foreach ( WC()->cart->cart_contents as $product ) :
192
  $product_ids[] = $product['product_id'];
217
  */
218
  public function wafs_match_condition_coupon( $match, $operator, $value ) {
219
 
220
+ if ( ! isset( WC()->cart ) ) return $match;
221
 
222
  if ( '==' == $operator ) :
223
  $match = ( in_array( $value, WC()->cart->applied_coupons ) );
244
  */
245
  public function wafs_match_condition_weight( $match, $operator, $value ) {
246
 
247
+ if ( ! isset( WC()->cart ) ) return $match;
248
 
249
  if ( '==' == $operator ) :
250
  $match = ( WC()->cart->cart_contents_weight == $value );
274
  * @return BOOL Matching result, TRUE if results match, otherwise FALSE. */
275
  public function wafs_match_condition_contains_shipping_class( $match, $operator, $value ) {
276
 
277
+ if ( ! isset( WC()->cart ) ) return $match;
278
 
279
  if ( $operator == '!=' ) :
280
  // True until proven false
283
 
284
  foreach ( WC()->cart->cart_contents as $product ) :
285
 
286
+ $id = ! empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
287
+ $product = get_product( $id );
288
 
289
  if ( $operator == '==' ) :
290
  if ( $product->get_shipping_class() == $value ) :
322
  */
323
  public function wafs_match_condition_zipcode( $match, $operator, $value ) {
324
 
325
+ if ( ! isset( WC()->customer ) ) return $match;
326
 
327
  if ( '==' == $operator ) :
328
 
365
  */
366
  public function wafs_match_condition_city( $match, $operator, $value ) {
367
 
368
+ if ( ! isset( WC()->customer ) ) return $match;
369
 
370
  if ( '==' == $operator ) :
371
  $match = ( preg_match( "/^$value$/i", WC()->customer->get_shipping_city() ) );
389
  * @param string $operator Operator selected by the user in the condition row.
390
  * @param mixed $value Value given by the user in the condition row.
391
  * @return BOOL Matching result, TRUE if results match, otherwise FALSE.
392
+ */
393
  public function wafs_match_condition_state( $match, $operator, $value ) {
394
 
395
+ if ( ! isset( WC()->customer ) ) return $match;
396
 
397
  $state = WC()->customer->get_shipping_country() . '_' . WC()->customer->get_shipping_state();
398
 
421
  */
422
  public function wafs_match_condition_country( $match, $operator, $value ) {
423
 
424
+ if ( ! isset( WC()->customer ) ) return $match;
425
 
426
  if ( '==' == $operator ) :
427
  $match = ( preg_match( "/^$value$/i", WC()->customer->get_shipping_country() ) );
481
  */
482
  public function wafs_match_condition_width( $match, $operator, $value ) {
483
 
484
+ if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return $match;
485
 
486
  foreach ( WC()->cart->cart_contents as $product ) :
487
 
524
  */
525
  public function wafs_match_condition_height( $match, $operator, $value ) {
526
 
527
+ if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return $match;
528
 
529
  foreach ( WC()->cart->cart_contents as $product ) :
530
 
567
  */
568
  public function wafs_match_condition_length( $match, $operator, $value ) {
569
 
570
+ if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return $match;
571
 
572
  foreach ( WC()->cart->cart_contents as $product ) :
573
 
610
  */
611
  public function wafs_match_condition_stock( $match, $operator, $value ) {
612
 
613
+ if ( ! isset( WC()->cart ) || empty( WC()->cart->cart_contents ) ) return $match;
614
 
615
  foreach ( WC()->cart->cart_contents as $product ) :
616
 
617
+ $product_id = ! empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
618
+ $stock[] = get_post_meta( $product_id, '_stock', true );
 
 
 
619
 
620
  endforeach;
621
 
650
  */
651
  public function wafs_match_condition_stock_status( $match, $operator, $value ) {
652
 
653
+ if ( ! isset( WC()->cart ) ) return $match;
654
 
655
  if ( '==' == $operator ) :
656
 
690
  */
691
  public function wafs_match_condition_category( $match, $operator, $value ) {
692
 
693
+ if ( ! isset( WC()->cart ) ) return $match;
694
 
695
  $match = true;
696
 
includes/class-wafs-post-type.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  /**
4
- * Class WAFS_post_type
5
  *
6
- * Initialize the WAFS post type
7
  *
8
  * @class WAFS_post_type
9
  * @author Jeroen Sormani
@@ -63,9 +63,11 @@ class WAFS_post_type {
63
  'label' => 'wafs',
64
  'show_ui' => true,
65
  'show_in_menu' => false,
 
 
66
  'capability_type' => 'post',
67
  'map_meta_cap' => true,
68
- 'rewrite' => array( 'slug' => 'wafs', 'with_front' => true ),
69
  '_builtin' => false,
70
  'query_var' => true,
71
  'supports' => array( 'title' ),
@@ -185,13 +187,7 @@ class WAFS_post_type {
185
  */
186
  public function wafs_save_condition_meta( $post_id ) {
187
 
188
- if ( ! isset( $_POST['wafs_conditions_meta_box_nonce'] ) ) :
189
- return $post_id;
190
- endif;
191
-
192
- $nonce = $_POST['wafs_conditions_meta_box_nonce'];
193
-
194
- if ( ! wp_verify_nonce( $nonce, 'wafs_conditions_meta_box' ) ) :
195
  return $post_id;
196
  endif;
197
 
@@ -219,13 +215,7 @@ class WAFS_post_type {
219
  */
220
  public function wafs_save_meta( $post_id ) {
221
 
222
- if ( ! isset( $_POST['wafs_settings_meta_box_nonce'] ) ) :
223
- return $post_id;
224
- endif;
225
-
226
- $nonce = $_POST['wafs_settings_meta_box_nonce'];
227
-
228
- if ( ! wp_verify_nonce( $nonce, 'wafs_settings_meta_box' ) ) :
229
  return $post_id;
230
  endif;
231
 
@@ -237,7 +227,7 @@ class WAFS_post_type {
237
  return $post_id;
238
  endif;
239
 
240
- $shipping_method = $_POST['_wafs_shipping_method'];
241
 
242
  update_post_meta( $post_id, '_wafs_shipping_method', $shipping_method );
243
 
@@ -259,17 +249,16 @@ class WAFS_post_type {
259
 
260
  if( isset( $_GET['trashed'] ) && intval( $_GET['trashed'] ) > 0 ) :
261
 
262
- $redirect = admin_url( '/admin.php?page=wc-settings&tab=shipping&section=wafs_free_shipping_method' );
263
- wp_redirect( $redirect );
264
  exit();
265
 
266
  endif;
267
 
268
  endif;
269
 
270
-
271
  }
272
 
 
273
  }
274
 
275
  /**
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
  /**
4
+ * Class WAFS_post_type.
5
  *
6
+ * Initialize the WAFS post type.
7
  *
8
  * @class WAFS_post_type
9
  * @author Jeroen Sormani
63
  'label' => 'wafs',
64
  'show_ui' => true,
65
  'show_in_menu' => false,
66
+ 'public' => false,
67
+ 'publicly_queryable' => false,
68
  'capability_type' => 'post',
69
  'map_meta_cap' => true,
70
+ 'rewrite' => false,
71
  '_builtin' => false,
72
  'query_var' => true,
73
  'supports' => array( 'title' ),
187
  */
188
  public function wafs_save_condition_meta( $post_id ) {
189
 
190
+ if ( ! isset( $_POST['wafs_conditions_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['wafs_conditions_meta_box_nonce'], 'wafs_conditions_meta_box' ) ) :
 
 
 
 
 
 
191
  return $post_id;
192
  endif;
193
 
215
  */
216
  public function wafs_save_meta( $post_id ) {
217
 
218
+ if ( ! isset( $_POST['wafs_settings_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['wafs_settings_meta_box_nonce'], 'wafs_settings_meta_box' ) ) :
 
 
 
 
 
 
219
  return $post_id;
220
  endif;
221
 
227
  return $post_id;
228
  endif;
229
 
230
+ $shipping_method = array_map( 'sanitize_text_field', $_POST['_wafs_shipping_method'] );
231
 
232
  update_post_meta( $post_id, '_wafs_shipping_method', $shipping_method );
233
 
249
 
250
  if( isset( $_GET['trashed'] ) && intval( $_GET['trashed'] ) > 0 ) :
251
 
252
+ wp_redirect( admin_url( '/admin.php?page=wc-settings&tab=shipping&section=wafs_free_shipping_method' ) );
 
253
  exit();
254
 
255
  endif;
256
 
257
  endif;
258
 
 
259
  }
260
 
261
+
262
  }
263
 
264
  /**
languages/woocommerce-advanced-free-shipping-it_IT.mo ADDED
Binary file
languages/woocommerce-advanced-free-shipping-it_IT.po ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce Advanced Free Shipping\n"
4
+ "POT-Creation-Date: 2014-04-24 19:17+0100\n"
5
+ "PO-Revision-Date: 2015-04-01 14:53+0100\n"
6
+ "Last-Translator: Stefano Callisto <stefano.callisto@gmail.com>\n"
7
+ "Language-Team: Stefano Callisto <stefano.callisto@gmail.com>\n"
8
+ "Language: it_IT\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.7.1\n"
13
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: ../\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-ajax.php:48
19
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-conditions.php:29
20
+ msgid "Or match all of the following rules to allow free shipping:"
21
+ msgstr "Oppure che soddisfi le seguenti regole per permettere la spedizione gratuita"
22
+
23
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-ajax.php:55
24
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-conditions.php:39
25
+ msgid "Or"
26
+ msgstr "Oppure"
27
+
28
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:18
29
+ msgid "Advanced Free Shipping"
30
+ msgstr "Advanced Free Shipping"
31
+
32
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:19
33
+ msgid "Configure WooCommerce Advanced Free Shipping"
34
+ msgstr "Configura WooCommerce Advanced Free Shipping"
35
+
36
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:128
37
+ msgid "Enable/Disable"
38
+ msgstr "Abilita/Disabilita"
39
+
40
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:130
41
+ msgid "Enable Advanced Free Shipping"
42
+ msgstr "Abilita Advanced Free Shipping"
43
+
44
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:134
45
+ msgid "Hide other shipping"
46
+ msgstr "Nascondi gli altri metodi di spedizione"
47
+
48
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:136
49
+ msgid "Hide other shipping methods when free shipping is available"
50
+ msgstr "Nascondi gli altri metodi di spedizione quando è disponibile la spedizione gratuita"
51
+
52
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-method.php:197
53
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:56
54
+ msgid "Free Shipping"
55
+ msgstr "Spedizione gratuita"
56
+
57
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:39
58
+ msgid "Advanced Free Shipping methods"
59
+ msgstr "Metodi Advanced Free Shipping"
60
+
61
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:40
62
+ msgid "Advanced Free Shipping method"
63
+ msgstr "Metodo Advanced Free Shipping"
64
+
65
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:41
66
+ msgid "Add New"
67
+ msgstr "Aggiungi nuovo"
68
+
69
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:42
70
+ msgid "Add New Advanced Free Shipping method"
71
+ msgstr "Aggiungi nuovo metodo Advanced Free Shipping"
72
+
73
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:43
74
+ msgid "Edit Advanced Free Shipping method"
75
+ msgstr "Modifica metodo Advanced Free Shipping"
76
+
77
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:44
78
+ msgid "New Advanced Free Shipping method"
79
+ msgstr "Nuovo metodo Advanced Free Shipping"
80
+
81
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:45
82
+ msgid "View Advanced Free Shipping method"
83
+ msgstr "Vedi metodo Advanced Free Shipping"
84
+
85
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:46
86
+ msgid "Search Advanced Free Shipping methods"
87
+ msgstr "Cerca metodi Advanced Free Shipping"
88
+
89
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:47
90
+ msgid "No Advanced Free Shipping methods"
91
+ msgstr "Nessun metodo Advanced Free Shipping"
92
+
93
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:48
94
+ msgid "No Advanced Free Shipping methods found in Trash"
95
+ msgstr "Nessun metodo Advanced Free Shipping nel cestino"
96
+
97
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:74
98
+ msgid "Advanced Free Shipping conditions"
99
+ msgstr "Condizioni Advanced Free Shipping"
100
+
101
+ #: ../woocommerce-advanced-free-shipping/includes/class-wafs-post-type.php:75
102
+ msgid "Shipping settings"
103
+ msgstr "Metodi di spedizione"
104
+
105
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-conditions.php:20
106
+ msgid "Match all of the following rules to allow free shipping:"
107
+ msgstr "Condizioni da soddisfare per permettere la spedizione gratuita"
108
+
109
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-conditions.php:54
110
+ msgid "Add 'Or' group"
111
+ msgstr "Aggiungi condizione \"oppure\""
112
+
113
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-settings.php:21
114
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:24
115
+ msgid "Shipping title"
116
+ msgstr "Nome spedizione"
117
+
118
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/meta-box-settings.php:23
119
+ msgid "e.g. Free Shipping"
120
+ msgstr "Es: \"Spedizione gratuita\""
121
+
122
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:6
123
+ msgid "Cart"
124
+ msgstr "Carrello"
125
+
126
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:7
127
+ msgid "Subtotal"
128
+ msgstr "Subtotale"
129
+
130
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:8
131
+ msgid "Subtotal ex. taxes"
132
+ msgstr "Subtotale tasse escluse"
133
+
134
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:9
135
+ msgid "Tax"
136
+ msgstr "Tassa"
137
+
138
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:10
139
+ msgid "Quantity"
140
+ msgstr "Quantità"
141
+
142
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:11
143
+ msgid "Contains product"
144
+ msgstr "Contiene prodotto"
145
+
146
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:12
147
+ msgid "Coupon"
148
+ msgstr "Codice"
149
+
150
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:14
151
+ msgid "User Details"
152
+ msgstr "Dettagli utente"
153
+
154
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:15
155
+ msgid "Zipcode"
156
+ msgstr "Codice postale/C.A.P."
157
+
158
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:16
159
+ msgid "City"
160
+ msgstr "Città"
161
+
162
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:17
163
+ msgid "Country"
164
+ msgstr "Nazione"
165
+
166
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:18
167
+ msgid "User role"
168
+ msgstr "Ruolo utente"
169
+
170
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:20
171
+ msgid "Product"
172
+ msgstr "Prodotto"
173
+
174
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:21
175
+ msgid "Width"
176
+ msgstr "Larghezza"
177
+
178
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:22
179
+ msgid "Height"
180
+ msgstr "Altezza"
181
+
182
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:23
183
+ msgid "Length"
184
+ msgstr "Lunghezza"
185
+
186
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:24
187
+ msgid "Weight"
188
+ msgstr "Peso"
189
+
190
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:25
191
+ msgid "Stock"
192
+ msgstr "Magazzino"
193
+
194
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:26
195
+ msgid "Stock status"
196
+ msgstr "Stato magazzino"
197
+
198
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:27
199
+ msgid "Backorders"
200
+ msgstr "Backorder"
201
+
202
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-conditions.php:28
203
+ msgid "Category"
204
+ msgstr "Categoria"
205
+
206
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:8
207
+ msgid "Weight calculated on all the cart contents"
208
+ msgstr "Peso calcolato su tutto ilcontenuto del carrello"
209
+
210
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:9
211
+ msgid "Compared to lengthiest product in cart"
212
+ msgstr "Rispetto al prodotto più lungo nel carrello"
213
+
214
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:10
215
+ msgid "Compared to widest product in cart"
216
+ msgstr "Rispetto al prodotto più largo nel carrello"
217
+
218
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:11
219
+ msgid "Compared to highest product in cart"
220
+ msgstr "Rispetto al prodotto più alto nel carrello"
221
+
222
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:12
223
+ msgid "All products in cart must match stock status"
224
+ msgstr "Tutti i prodotti nel carrello devono appartenere allo stato del magazzino"
225
+
226
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:13
227
+ msgid "All products in cart must match backorder"
228
+ msgstr "Tutti i prodotti nel carrello devono essere in backorder"
229
+
230
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:14
231
+ msgid "All products in cart must match category"
232
+ msgstr "Tutti i prodotti nel carrello devono appartenere alla categoria"
233
+
234
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-descriptions.php:15
235
+ msgid "Cart must contain one of this product"
236
+ msgstr "Il carrello deve contenere almeno uno di questo prodotto"
237
+
238
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-operators.php:6
239
+ msgid "Equal to"
240
+ msgstr "Uguale a"
241
+
242
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-operators.php:7
243
+ msgid "Not equal to"
244
+ msgstr "Diverso da"
245
+
246
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-operators.php:8
247
+ msgid "Greater or equal to"
248
+ msgstr "Uguale o maggiore di"
249
+
250
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-operators.php:9
251
+ msgid "Less or equal to "
252
+ msgstr "Uguale o minore di"
253
+
254
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-values.php:122
255
+ msgid "In stock"
256
+ msgstr "Disponibile"
257
+
258
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-values.php:123
259
+ msgid "Out of stock"
260
+ msgstr "Non disponibile"
261
+
262
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-values.php:132
263
+ msgid "Do not allow"
264
+ msgstr "Non permettere"
265
+
266
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-values.php:133
267
+ msgid "Allow, but notify customer"
268
+ msgstr "Permetti, ma avvisa il cliente"
269
+
270
+ #: ../woocommerce-advanced-free-shipping/includes/admin/settings/conditions/condition-values.php:134
271
+ msgid "Allow"
272
+ msgstr "Permetti"
273
+
274
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:15
275
+ msgid "Method conditions"
276
+ msgstr "Condizioni"
277
+
278
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:23
279
+ msgid "Title"
280
+ msgstr "Titolo"
281
+
282
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:25
283
+ msgid "Condition groups"
284
+ msgstr "Numero di condizioni"
285
+
286
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:26
287
+ msgid "Author"
288
+ msgstr "Autore"
289
+
290
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:38
291
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:44
292
+ msgid "Edit Method"
293
+ msgstr "Modifica metodo"
294
+
295
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:39
296
+ msgid "Untitled"
297
+ msgstr "Senza titolo"
298
+
299
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:45
300
+ msgid "Edit"
301
+ msgstr "Modifica"
302
+
303
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:50
304
+ msgid "Delete Method"
305
+ msgstr "Elimina metodo"
306
+
307
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:51
308
+ msgid "Delete"
309
+ msgstr "Elimina"
310
+
311
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:67
312
+ msgid "There are no Free Shipping conditions. Yet..."
313
+ msgstr "Non ci sono (ancora) condizioni per la spedizione gratuita"
314
+
315
+ #: ../woocommerce-advanced-free-shipping/includes/admin/views/conditions-table.php:76
316
+ msgid "Add Free Shipping Method"
317
+ msgstr "Aggiungi metodo per spedizione gratuita"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: sormano
3
  Donate link: http://www.jeroensormani.com/donate/
4
  Tags: woocommerce, shipping, woocommerce shipping, woocommerce free shipping, woocommerce free, woocommerce advanced free shipping, wc free shipping, wc shipping, advanced shipping, pro shipping, table rate shipping, country shipping, free shipping
5
  Requires at least: 3.6
6
- Tested up to: 4.1
7
- Stable tag: 1.0.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -26,11 +26,31 @@ WooCommerce Advanced Free Shipping is an plugin which allows you to set up advan
26
 
27
  **Look at the screenshots!**
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  **Translations, feature requests, ratings and donations are welcome and appreciated!**
30
 
31
- ** Translations **
32
 
33
  - Spanish [(Andres Felipe)](https://wordpress.org/support/profile/naturalworldstm)
 
34
 
35
  == Installation ==
36
 
@@ -46,6 +66,12 @@ WooCommerce Advanced Free Shipping is an plugin which allows you to set up advan
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
49
  = 1.0.5 - 14-12-2014 =
50
 
51
  * Fix - Hide other shipping doesn't save in rare cases
3
  Donate link: http://www.jeroensormani.com/donate/
4
  Tags: woocommerce, shipping, woocommerce shipping, woocommerce free shipping, woocommerce free, woocommerce advanced free shipping, wc free shipping, wc shipping, advanced shipping, pro shipping, table rate shipping, country shipping, free shipping
5
  Requires at least: 3.6
6
+ Tested up to: 4.2.2
7
+ Stable tag: 1.0.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
26
 
27
  **Look at the screenshots!**
28
 
29
+ > **Applying shipping cost**<br /><br />
30
+ > Have you givin this plugin a shot and like how you can set things up?<br />
31
+ > Another plugin is available that allows you to setup shipping cost with the same conditional logic options as this plugin!<br /><br />
32
+ > **Features:**<br />
33
+ > - Add shipping cost to the shipping rates<br />
34
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Per weight*<br />
35
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Per item*<br />
36
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Extra handling fee*<br />
37
+ > - Setup a percentage based fee<br />
38
+ > - Add Advanced shipping cost via the WAS Advanced Pricing extension<br />
39
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Cost per shipping class*<br />
40
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Cost per category*<br />
41
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Cost per product*<br />
42
+ > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- *Cost per weight (table rate)*<br />
43
+ > - Create shipping zones<br />
44
+ > - Set tax status<br />
45
+ > <br />
46
+ > View [WooCommerce Advanced Shipping](http://codecanyon.net/item/woocommerce-advanced-shipping/8634573)
47
+
48
  **Translations, feature requests, ratings and donations are welcome and appreciated!**
49
 
50
+ **Translations**
51
 
52
  - Spanish [(Andres Felipe)](https://wordpress.org/support/profile/naturalworldstm)
53
+ - Italian (Stefano Callisto)
54
 
55
  == Installation ==
56
 
66
 
67
  == Changelog ==
68
 
69
+ = 1.0.6 - 04-06-2015 =
70
+
71
+ * [Add] - Escaping/sanitizing to different elements
72
+ * Improvement - Shipping class matching function now uses varation shiping class instead of the parents'
73
+ * [i18n] - Add Italian translation
74
+
75
  = 1.0.5 - 14-12-2014 =
76
 
77
  * Fix - Hide other shipping doesn't save in rare cases
woocommerce-advanced-free-shipping.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.jeroensormani.com/
5
  * Donate link: http://www.jeroensormani.com/donate/
6
  * Description: WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions.
7
- * Version: 1.0.5
8
  * Author: Jeroen Sormani
9
  * Author URI: http://www.jeroensormani.com/
10
  * Text Domain: woocommerce-advanced-free-shipping
@@ -30,10 +30,11 @@
30
  */
31
 
32
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
33
  /**
34
- * Class Woocommerce_Advanced_Free_Shipping
35
  *
36
- * Main WAFS class, add filters and handling all other files
37
  *
38
  * @class Woocommerce_Advanced_Free_Shipping
39
  * @version 1.0.0
@@ -48,7 +49,7 @@ class WooCommerce_Advanced_Free_Shipping {
48
  * @since 1.0.4
49
  * @var string $version Plugin version number.
50
  */
51
- public $version = '1.0.5';
52
 
53
 
54
  /**
@@ -146,7 +147,8 @@ class WooCommerce_Advanced_Free_Shipping {
146
  /**
147
  * Update.
148
  *
149
- * Update function.
 
150
  *
151
  * @since 1.0.3
152
  */
4
  * Plugin URI: http://www.jeroensormani.com/
5
  * Donate link: http://www.jeroensormani.com/donate/
6
  * Description: WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions.
7
+ * Version: 1.0.6
8
  * Author: Jeroen Sormani
9
  * Author URI: http://www.jeroensormani.com/
10
  * Text Domain: woocommerce-advanced-free-shipping
30
  */
31
 
32
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
33
+
34
  /**
35
+ * Class Woocommerce_Advanced_Free_Shipping.
36
  *
37
+ * Main WAFS class, add filters and handling all other files.
38
  *
39
  * @class Woocommerce_Advanced_Free_Shipping
40
  * @version 1.0.0
49
  * @since 1.0.4
50
  * @var string $version Plugin version number.
51
  */
52
+ public $version = '1.0.6';
53
 
54
 
55
  /**
147
  /**
148
  * Update.
149
  *
150
+ * Runs when the plugin is updated and checks if there should be
151
+ * any data updated to be compatible for the new version.
152
  *
153
  * @since 1.0.3
154
  */