Flexible Shipping for WooCommerce - Version 1.7

Version Description

  • 2016-12-14 =
  • Added WPML and Polylang support
  • Added custom "free shipping" label
  • Removed decrecated enable/disable for main shipping method
  • Fixed choosing default shipping method in the checkout
Download this release

Release Info

Developer wpdesk
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.2 to 1.7

assets/css/admin.css CHANGED
@@ -1,5 +1,24 @@
1
  @CHARSET "UTF-8";
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  table.flexible_shipping_method_rules td p,
4
  table.flexible_shipping_method_rules td p input,
5
  table.flexible_shipping_method_rules td p select {
1
  @CHARSET "UTF-8";
2
 
3
+ table.flexible_shipping_methods th.select,
4
+ table.flexible_shipping_methods td.select {
5
+ text-align: center;
6
+ width: 40px;
7
+ margin-top: -7px;
8
+ margin-left: -6px;
9
+ }
10
+
11
+ input.checkbox-select-all {
12
+ margin: 0 12px 0 8px !important;
13
+ }
14
+
15
+ table.flexible_shipping_methods th.integration,
16
+ table.flexible_shipping_methods td.integration {
17
+ text-align: center;
18
+ width: 130px;
19
+ }
20
+
21
+
22
  table.flexible_shipping_method_rules td p,
23
  table.flexible_shipping_method_rules td p input,
24
  table.flexible_shipping_method_rules td p select {
classes/settings-flexible-shipping.php CHANGED
@@ -50,4 +50,8 @@ $settings = array(
50
  ),
51
  );
52
 
 
 
 
 
53
  return $settings;
50
  ),
51
  );
52
 
53
+ if ( version_compare( WC()->version, '2.6' ) >= 0 ) {
54
+ //unset( $settings['enabled'] );
55
+ }
56
+
57
  return $settings;
classes/settings-shipping-method-form.php CHANGED
@@ -15,6 +15,12 @@ foreach ( WC()->shipping->get_shipping_classes() as $shipping_class ) {
15
  $integrations = get_locale() === 'pl_PL' ? sprintf( __( '%sAdd integrations%s with DHL, Paczkomaty InPost, eNadawca Poczta Polska, Paczka w Ruchu.', 'flexible-shipping' ), '<a href="https://www.wpdesk.pl/kategoria-produktu/wysylka/?utm_source=flexible-shipping-method&utm_medium=text-link&utm_campaign=flexible-shipping-integrations" target="_blank">', ' &rarr;</a>' ) : '';
16
  $integrations_tip = get_locale() === 'pl_PL' ? false : true;
17
 
 
 
 
 
 
 
18
  $settings = array(
19
  'method_enabled' => array(
20
  'title' => __( 'Enable/Disable', 'flexible-shipping' ),
@@ -39,15 +45,32 @@ $settings = array(
39
  'desc_tip' => true,
40
  'default' => $shipping_method['method_description'],
41
  ),
 
 
 
 
 
42
  'method_free_shipping' => array(
43
- 'title' => __( 'Free shipping', 'flexible-shipping' ),
44
  'type' => 'price',
45
  'default' => $shipping_method['method_free_shipping'],
46
  'description' => __( 'Enter a minimum order amount for free shipping. This will override the costs configured below.', 'flexible-shipping' ),
47
  'desc_tip' => true
48
  ),
 
 
 
 
 
 
 
 
 
 
 
 
49
  'method_calculation_method' => array(
50
- 'title' => __( 'Calculation method', 'flexible-shipping' ),
51
  'type' => 'select',
52
  'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
53
  'default' => $shipping_method['method_calculation_method'],
@@ -69,7 +92,7 @@ $settings = array(
69
  'method_integration' => array(
70
  'title' => __( 'Integration', 'flexible-shipping' ),
71
  'type' => 'select',
72
- 'description' => __( 'Select integration. ' , 'flexible-shipping' ) . $integrations ,
73
  'desc_tip' => $integrations_tip,
74
  'default' => $shipping_method['method_integration'],
75
  'options' => apply_filters( 'flexible_shipping_integration_options' , array( '' => __( 'None', 'flexible-shipping' ) ) )
@@ -78,6 +101,10 @@ $settings = array(
78
 
79
  $settings = apply_filters( 'flexible_shipping_method_settings', $settings, $shipping_method );
80
 
 
 
 
 
81
  $settings['method_rules'] = array(
82
  'title' => __( 'Rules', 'flexible-shipping' ),
83
  'type' => 'shipping_rules',
@@ -85,6 +112,10 @@ $settings['method_rules'] = array(
85
  'method_title' => $shipping_method['method_title'],
86
  );
87
 
 
 
 
 
88
  if ( class_exists('WC_Shipping_Zones1') ) {
89
  $shipping_zones = WC_Shipping_Zones::get_zones();
90
  $shipping_zones_options = array();
15
  $integrations = get_locale() === 'pl_PL' ? sprintf( __( '%sAdd integrations%s with DHL, Paczkomaty InPost, eNadawca Poczta Polska, Paczka w Ruchu.', 'flexible-shipping' ), '<a href="https://www.wpdesk.pl/kategoria-produktu/wysylka/?utm_source=flexible-shipping-method&utm_medium=text-link&utm_campaign=flexible-shipping-integrations" target="_blank">', ' &rarr;</a>' ) : '';
16
  $integrations_tip = get_locale() === 'pl_PL' ? false : true;
17
 
18
+ if ( !isset( $shipping_method['method_free_shipping_label'] ) ) {
19
+ $shipping_method['method_free_shipping_label'] = __( 'Free', 'flexible-shipping' );
20
+ }
21
+
22
+ $this->settings['method_free_shipping'] = $shipping_method['method_free_shipping'];
23
+
24
  $settings = array(
25
  'method_enabled' => array(
26
  'title' => __( 'Enable/Disable', 'flexible-shipping' ),
45
  'desc_tip' => true,
46
  'default' => $shipping_method['method_description'],
47
  ),
48
+ array(
49
+ 'title' => '',
50
+ 'type' => 'title',
51
+ 'description' => '',
52
+ ),
53
  'method_free_shipping' => array(
54
+ 'title' => __( 'Free Shipping', 'flexible-shipping' ),
55
  'type' => 'price',
56
  'default' => $shipping_method['method_free_shipping'],
57
  'description' => __( 'Enter a minimum order amount for free shipping. This will override the costs configured below.', 'flexible-shipping' ),
58
  'desc_tip' => true
59
  ),
60
+ 'method_free_shipping_label' => array(
61
+ 'title' => __( 'Free Shipping Label', 'flexible-shipping' ),
62
+ 'type' => 'text',
63
+ 'default' => $shipping_method['method_free_shipping_label'],
64
+ 'description' => __( 'Enter additional label for shipping when free shipping available.', 'flexible-shipping' ),
65
+ 'desc_tip' => true
66
+ ),
67
+ array(
68
+ 'title' => '',
69
+ 'type' => 'title',
70
+ 'description' => '',
71
+ ),
72
  'method_calculation_method' => array(
73
+ 'title' => __( 'Calculation Method', 'flexible-shipping' ),
74
  'type' => 'select',
75
  'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
76
  'default' => $shipping_method['method_calculation_method'],
92
  'method_integration' => array(
93
  'title' => __( 'Integration', 'flexible-shipping' ),
94
  'type' => 'select',
95
+ 'description' => __( 'Select integration. ' , 'flexible-shipping' ) . $integrations,
96
  'desc_tip' => $integrations_tip,
97
  'default' => $shipping_method['method_integration'],
98
  'options' => apply_filters( 'flexible_shipping_integration_options' , array( '' => __( 'None', 'flexible-shipping' ) ) )
101
 
102
  $settings = apply_filters( 'flexible_shipping_method_settings', $settings, $shipping_method );
103
 
104
+ if ( isset( $settings['method_max_cost'] ) ) {
105
+ $this->settings['method_max_cost'] = $settings['method_max_cost']['default'];
106
+ }
107
+
108
  $settings['method_rules'] = array(
109
  'title' => __( 'Rules', 'flexible-shipping' ),
110
  'type' => 'shipping_rules',
112
  'method_title' => $shipping_method['method_title'],
113
  );
114
 
115
+ if ( version_compare( WC()->version, '2.6' ) < 0 ) {
116
+ unset( $settings['method_free_shipping_label'] );
117
+ }
118
+
119
  if ( class_exists('WC_Shipping_Zones1') ) {
120
  $shipping_zones = WC_Shipping_Zones::get_zones();
121
  $shipping_zones_options = array();
classes/shipping_method.php CHANGED
@@ -46,6 +46,7 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
46
  );
47
 
48
  $this->enabled = $this->get_option( 'enabled' );
 
49
  $this->title = $this->get_option( 'title' );
50
 
51
  $this->init();
@@ -179,7 +180,7 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
179
  }
180
 
181
  public function update_rates($shipping_methods) {
182
- $retes = array();
183
  foreach ( $shipping_methods as $shipping_method ) {
184
  $id = $this->id . '_' . $this->instance_id . '_' . sanitize_title($shipping_method['method_title'] );
185
  $id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
@@ -204,20 +205,28 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
204
  $shipping_methods = get_option( $this->shipping_methods_option, array() );
205
  $shipping_method_order = get_option( $this->shipping_method_order_option, array() );
206
  //
207
- $method_id = 0;
 
208
  foreach ( $shipping_methods as $shipping_method ) {
209
- if ( $shipping_method['id'] > $method_id ) $method_id = $shipping_method['id'];
210
  }
211
  $method_id++;
 
212
  //
 
213
  }
214
  else {
215
  $method_id = $_POST['method_id'];
 
216
  }
217
  $shipping_method['id'] = $method_id;
 
218
  $shipping_method['method_title'] = $_POST['woocommerce_' . $this->id . '_method_title'];
219
  $shipping_method['method_description'] = $_POST['woocommerce_' . $this->id . '_method_description'];
220
  $shipping_method['method_free_shipping'] = $_POST['woocommerce_' . $this->id . '_method_free_shipping'];
 
 
 
221
  $shipping_method['method_calculation_method'] = $_POST['woocommerce_' . $this->id . '_method_calculation_method'];
222
  $shipping_method['method_visibility'] = 'no';
223
  if ( isset( $_POST['woocommerce_' . $this->id . '_method_visibility'] ) && $_POST['woocommerce_' . $this->id . '_method_visibility'] == 1 )
@@ -301,6 +310,7 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
301
  'method_shipping_zone' => '',
302
  'method_calculation_method' => 'sum',
303
  'method_free_shipping' => '',
 
304
  'method_visibility' => 'no',
305
  'method_default' => 'no',
306
  'method_integration' => '',
@@ -309,10 +319,16 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
309
  if ( $action == 'edit' ) {
310
  $method_id = $_GET['method_id'];
311
  $shipping_method = $shipping_methods[$method_id];
 
 
 
 
 
312
  }
313
  ?>
314
  <input type="hidden" name="method_action" value="<?php echo $action; ?>" />
315
  <input type="hidden" name="method_id" value="<?php echo $method_id; ?>" />
 
316
  <?php if ( $action == 'new' ) : ?>
317
  <h2><?php _e('New Shipping Method', 'flexible-shipping' ); ?></h2>
318
  <?php endif; ?>
@@ -336,23 +352,27 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
336
  $this->generate_settings_html( $this->get_shipping_method_form($shipping_method) );
337
  }
338
  else if ( $action == 'delete' ) {
339
- $method_id = $_GET['method_id'];
 
 
 
340
  $shipping_methods = get_option( $this->shipping_methods_option, array() );
341
  $shipping_method_order = get_option( $this->shipping_method_order_option, array() );
342
- if ( isset( $shipping_methods[$method_id] ) )
343
- {
344
- $shipping_method = $shipping_methods[$method_id];
345
- unset( $shipping_methods[$method_id] );
346
- if ( isset( $shipping_method_order[$method_id] ) ) {
347
- unset( $shipping_method_order[$method_id] );
348
- }
349
- update_option( $this->shipping_methods_option, $shipping_methods );
350
- update_option( $this->shipping_method_order_option, $shipping_method_order );
351
- WC_Admin_Settings::add_message( sprintf(__('Shipping method %s deleted.', 'flexible-shipping' ), $shipping_method['method_title'] ) );
352
- }
353
- else {
354
- WC_Admin_Settings::add_error( __( 'Shipping method not found.', 'flexible-shipping' ) );
355
- }
 
356
  WC_Admin_Settings::show_messages();
357
  $this->generate_settings_html();
358
  }
@@ -543,34 +563,54 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
543
  $cost = 0;
544
  }
545
  }
 
 
 
 
 
 
 
 
 
 
 
 
546
 
547
  $id = $this->id . '_' . $this->instance_id . '_' . sanitize_title( $shipping_method['method_title'] );
548
  $id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
549
  $this->add_rate( array(
550
  'id' => $id,
551
- 'label' => $shipping_method['method_title'],
552
  'cost' => $cost,
553
  'method' => $shipping_method,
554
- 'rule_costs' => $rule_costs,
 
 
 
555
  ) );
556
  if ( isset( $shipping_method['method_description'] ) ) {
557
- WC()->session->set('flexible_shipping_description_' . $id, $shipping_method['method_description'] );
558
  }
559
  else {
560
  WC()->session->set( 'flexible_shipping_description_' . $id, '' );
561
  }
562
- if ( !$default_method_is_set && isset( $shipping_method['method_default'] ) && $shipping_method['method_default'] == 'yes' ) {
563
- $chosen_shipping_method = WC()->session->get( 'chosen_shipping_methods', array() );
564
- if ( empty( $chosen_shipping_method['0'] ) ) {
565
- WC()->session->set('chosen_shipping_methods', array( '0' => $id ) );
566
- $default_method_is_set = true;
567
- }
568
- }
 
569
  }
570
  }
571
  }
572
  }
573
 
 
 
 
 
574
  public function get_all_rates() {
575
  if ( class_exists( 'WC_Shipping_Zones' ) ) {
576
  $zones = WC_Shipping_Zones::get_zones();
46
  );
47
 
48
  $this->enabled = $this->get_option( 'enabled' );
49
+
50
  $this->title = $this->get_option( 'title' );
51
 
52
  $this->init();
180
  }
181
 
182
  public function update_rates($shipping_methods) {
183
+ $rates = array();
184
  foreach ( $shipping_methods as $shipping_method ) {
185
  $id = $this->id . '_' . $this->instance_id . '_' . sanitize_title($shipping_method['method_title'] );
186
  $id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
205
  $shipping_methods = get_option( $this->shipping_methods_option, array() );
206
  $shipping_method_order = get_option( $this->shipping_method_order_option, array() );
207
  //
208
+ $method_id = get_option( 'flexible_shipping_method_id', 0 );
209
+ //$method_id = 0;
210
  foreach ( $shipping_methods as $shipping_method ) {
211
+ if ( intval( $shipping_method['id'] ) > $method_id ) $method_id = intval( $shipping_method['id'] );
212
  }
213
  $method_id++;
214
+ update_option( 'flexible_shipping_method_id', $method_id );
215
  //
216
+ $method_id_for_shipping = $this->id . '_' . $this->instance_id . '_' . $method_id;
217
  }
218
  else {
219
  $method_id = $_POST['method_id'];
220
+ $method_id_for_shipping = $_POST['method_id_for_shipping'];
221
  }
222
  $shipping_method['id'] = $method_id;
223
+ $shipping_method['id_for_shipping'] = $method_id_for_shipping;
224
  $shipping_method['method_title'] = $_POST['woocommerce_' . $this->id . '_method_title'];
225
  $shipping_method['method_description'] = $_POST['woocommerce_' . $this->id . '_method_description'];
226
  $shipping_method['method_free_shipping'] = $_POST['woocommerce_' . $this->id . '_method_free_shipping'];
227
+ if ( version_compare( WC()->version, '2.6' ) >= 0 ) {
228
+ $shipping_method['method_free_shipping_label'] = $_POST['woocommerce_' . $this->id . '_method_free_shipping_label'];
229
+ }
230
  $shipping_method['method_calculation_method'] = $_POST['woocommerce_' . $this->id . '_method_calculation_method'];
231
  $shipping_method['method_visibility'] = 'no';
232
  if ( isset( $_POST['woocommerce_' . $this->id . '_method_visibility'] ) && $_POST['woocommerce_' . $this->id . '_method_visibility'] == 1 )
310
  'method_shipping_zone' => '',
311
  'method_calculation_method' => 'sum',
312
  'method_free_shipping' => '',
313
+ 'method_free_shipping_label'=> '',
314
  'method_visibility' => 'no',
315
  'method_default' => 'no',
316
  'method_integration' => '',
319
  if ( $action == 'edit' ) {
320
  $method_id = $_GET['method_id'];
321
  $shipping_method = $shipping_methods[$method_id];
322
+ $method_id_for_shipping = $this->id . '_' . $this->instance_id . '_' . sanitize_title( $shipping_method['method_title'] );
323
+ $method_id_for_shipping = apply_filters( 'flexible_shipping_method_rate_id', $method_id_for_shipping, $shipping_method );
324
+ }
325
+ else {
326
+ $method_id_for_shipping = '';
327
  }
328
  ?>
329
  <input type="hidden" name="method_action" value="<?php echo $action; ?>" />
330
  <input type="hidden" name="method_id" value="<?php echo $method_id; ?>" />
331
+ <input type="hidden" name="method_id_for_shipping" value="<?php echo $method_id_for_shipping; ?>" />
332
  <?php if ( $action == 'new' ) : ?>
333
  <h2><?php _e('New Shipping Method', 'flexible-shipping' ); ?></h2>
334
  <?php endif; ?>
352
  $this->generate_settings_html( $this->get_shipping_method_form($shipping_method) );
353
  }
354
  else if ( $action == 'delete' ) {
355
+ $methods_id = '';
356
+ if ( isset( $_GET['methods_id'] ) ) {
357
+ $methods_id = explode( ',' , $_GET['methods_id'] );
358
+ }
359
  $shipping_methods = get_option( $this->shipping_methods_option, array() );
360
  $shipping_method_order = get_option( $this->shipping_method_order_option, array() );
361
+ foreach ( $methods_id as $method_id ) {
362
+ if ( isset( $shipping_methods[$method_id] ) ) {
363
+ $shipping_method = $shipping_methods[$method_id];
364
+ unset( $shipping_methods[$method_id] );
365
+ if ( isset( $shipping_method_order[$method_id] ) ) {
366
+ unset( $shipping_method_order[$method_id] );
367
+ }
368
+ update_option( $this->shipping_methods_option, $shipping_methods );
369
+ update_option( $this->shipping_method_order_option, $shipping_method_order );
370
+ WC_Admin_Settings::add_message( sprintf(__('Shipping method %s deleted.', 'flexible-shipping' ), $shipping_method['method_title'] ) );
371
+ }
372
+ else {
373
+ WC_Admin_Settings::add_error( __( 'Shipping method not found.', 'flexible-shipping' ) );
374
+ }
375
+ }
376
  WC_Admin_Settings::show_messages();
377
  $this->generate_settings_html();
378
  }
563
  $cost = 0;
564
  }
565
  }
566
+
567
+ $method_title = wpdesk__( $shipping_method['method_title'], 'flexible-shipping' );
568
+ if ( version_compare( WC()->version, '2.6' ) >= 0 ) {
569
+ if ( $cost == 0 ) {
570
+ if ( ! isset( $shipping_method['method_free_shipping_label'] ) ) {
571
+ $shipping_method['method_free_shipping_label'] = __( 'Free', 'flexible-shipping' );
572
+ }
573
+ if ( $shipping_method['method_free_shipping_label'] != '' ) {
574
+ $method_title .= ' (' . wpdesk__( $shipping_method['method_free_shipping_label'], 'flexible-shipping' ) . ')';
575
+ }
576
+ }
577
+ }
578
 
579
  $id = $this->id . '_' . $this->instance_id . '_' . sanitize_title( $shipping_method['method_title'] );
580
  $id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
581
  $this->add_rate( array(
582
  'id' => $id,
583
+ 'label' => $method_title,
584
  'cost' => $cost,
585
  'method' => $shipping_method,
586
+ 'rule_costs' => $rule_costs,
587
+ 'meta_data' => array(
588
+ 'default' => $shipping_method['method_default']
589
+ )
590
  ) );
591
  if ( isset( $shipping_method['method_description'] ) ) {
592
+ WC()->session->set('flexible_shipping_description_' . $id, wpdesk__( $shipping_method['method_description'], 'flexible-shipping' ) );
593
  }
594
  else {
595
  WC()->session->set( 'flexible_shipping_description_' . $id, '' );
596
  }
597
+ if ( !$default_method_is_set && isset( $shipping_method['method_default'] ) && $shipping_method['method_default'] == 'yes' ) {
598
+ $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods', array() );
599
+ if ( !isset( $chosen_shipping_methods[0] ) ) {
600
+ $chosen_shipping_methods[0] = $id;
601
+ WC()->session->set('chosen_shipping_methods', $chosen_shipping_methods );
602
+ $default_method_is_set = true;
603
+ }
604
+ }
605
  }
606
  }
607
  }
608
  }
609
 
610
+ public function is_available( $package ) {
611
+ return parent::is_available( $package );
612
+ }
613
+
614
  public function get_all_rates() {
615
  if ( class_exists( 'WC_Shipping_Zones' ) ) {
616
  $zones = WC_Shipping_Zones::get_zones();
classes/views/html-shipping-method-settings.php CHANGED
@@ -12,7 +12,7 @@
12
  width: auto;
13
  }
14
  </style>
15
- <table class="wc_shipping widefat wp-list-table" cellspacing="0">
16
  <thead>
17
  <tr>
18
  <th class="sort">&nbsp;</th>
@@ -21,7 +21,7 @@
21
  <th class="visibility"><?php _e( 'Visibility', 'flexible-shipping' ); ?></th>
22
  <th class="default"><?php _e( 'Default', 'flexible-shipping' ); ?></th>
23
  <th class="integration"><?php _e( 'Integration', 'flexible-shipping' ); ?></th>
24
- <th class="action"><?php _e( 'Action', 'flexible-shipping' ); ?></th>
25
  </tr>
26
  </thead>
27
  <tbody>
@@ -64,11 +64,8 @@
64
  <?php endif; ?>
65
  </td>
66
  <?php echo apply_filters( 'flexible_shipping_method_integration_col', '<td width="1%" class="integration default">-</td>', $shipping_method );?>
67
- <td width="1%" class="action" nowrap>
68
- <?php /* ?>
69
- <a class="button" href="?page=wc-settings&amp;tab=shipping&amp;section=<?php echo $this->section_name; ?>&amp;action=delete&method_id=<?php echo $shipping_method_id; ?>"><?php _e( 'Delete', 'flexible-shipping' ); ?></a>
70
- <?php */ ?>
71
- <a class="button" href="<?php echo add_query_arg( 'method_id' , $shipping_method_id, add_query_arg( 'action', 'delete' ) ); ?>"><?php _e( 'Delete', 'flexible-shipping' ); ?></a>
72
  </td>
73
  </tr>
74
  <?php endforeach; ?>
@@ -79,6 +76,12 @@
79
  <th>&nbsp;</th>
80
  <th colspan="8"><span class="description"><?php _e( 'Drag and drop the above shipping methods to control their display order. Confirm by clicking Save changes button below.', 'flexible-shipping' ); ?></span></th>
81
  </tr>
 
 
 
 
 
 
82
  </tfoot>
83
  </table>
84
 
@@ -97,7 +100,41 @@
97
  $content .= '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=' . absint( $zone->get_zone_id() ) ) . '">' . esc_html( $zone->get_zone_name() ) . '</a> &gt';
98
  $content .= esc_html( $shipping_method_woo->get_title() );
99
  ?>
100
- jQuery('#mainform h2').first().replaceWith( '<h2>' + '<?php echo $content; ?>' + '</h2>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  </script>
102
  <?php
103
  }
12
  width: auto;
13
  }
14
  </style>
15
+ <table class="flexible_shipping_methods wc_shipping widefat wp-list-table" cellspacing="0">
16
  <thead>
17
  <tr>
18
  <th class="sort">&nbsp;</th>
21
  <th class="visibility"><?php _e( 'Visibility', 'flexible-shipping' ); ?></th>
22
  <th class="default"><?php _e( 'Default', 'flexible-shipping' ); ?></th>
23
  <th class="integration"><?php _e( 'Integration', 'flexible-shipping' ); ?></th>
24
+ <th class="select"><input type="checkbox" class="tips checkbox-select-all" value="1" data-tip="<?php _e( 'Select all', 'flexible-shipping' ); ?>" /></th>
25
  </tr>
26
  </thead>
27
  <tbody>
64
  <?php endif; ?>
65
  </td>
66
  <?php echo apply_filters( 'flexible_shipping_method_integration_col', '<td width="1%" class="integration default">-</td>', $shipping_method );?>
67
+ <td width="1%" class="select" nowrap>
68
+ <input type="checkbox" class="tips checkbox-select" value="<?php echo esc_attr( $shipping_method['id'] ); ?>" data-tip="<?php echo esc_html( $shipping_method['method_title'] ); ?>" />
 
 
 
69
  </td>
70
  </tr>
71
  <?php endforeach; ?>
76
  <th>&nbsp;</th>
77
  <th colspan="8"><span class="description"><?php _e( 'Drag and drop the above shipping methods to control their display order. Confirm by clicking Save changes button below.', 'flexible-shipping' ); ?></span></th>
78
  </tr>
79
+ <tr>
80
+ <th>&nbsp;</th>
81
+ <th colspan="8">
82
+ <button id="flexible_shipping_remove_selected" class="button"><?php _e( 'Remove selected', 'flexible-shipping' ); ?></button>
83
+ </th>
84
+ </tr>
85
  </tfoot>
86
  </table>
87
 
100
  $content .= '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=' . absint( $zone->get_zone_id() ) ) . '">' . esc_html( $zone->get_zone_name() ) . '</a> &gt';
101
  $content .= esc_html( $shipping_method_woo->get_title() );
102
  ?>
103
+ jQuery('#mainform h2').first().replaceWith( '<h2>' + '<?php echo $content; ?>' + '</h2>' );
104
+
105
+ jQuery("input.checkbox-select-all").click(function(){
106
+ if ( jQuery(this).is(':checked') ) {
107
+ jQuery('input.checkbox-select').prop('checked', true);
108
+ }
109
+ else {
110
+ jQuery('input.checkbox-select').prop('checked', false);
111
+ }
112
+ })
113
+
114
+ jQuery('#flexible_shipping_remove_selected').click(function(){
115
+ var url = '<?php echo add_query_arg( 'methods_id' , '', add_query_arg( 'action', 'delete' ) ); ?>';
116
+ var first = true;
117
+ jQuery('input.checkbox-select').each(function(){
118
+ if ( jQuery(this).is(':checked')) {
119
+ if ( !first ) {
120
+ url = url + ',';
121
+ }
122
+ else {
123
+ url = url + '=';
124
+ }
125
+ url = url + jQuery(this).val();
126
+ first = false;
127
+ }
128
+ })
129
+ console.log(url);
130
+ if ( url != '<?php echo add_query_arg( 'method_id' , '', add_query_arg( 'action', 'delete' ) ); ?>' ) {
131
+ jQuery('#flexible_shipping_remove_selected').prop('disabled',true);
132
+ jQuery('.woocommerce-save-button').prop('disabled',true);
133
+ window.location.href = url;
134
+ }
135
+ return false;
136
+ })
137
+
138
  </script>
139
  <?php
140
  }
flexible-shipping.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipping methods in WooCommerce and enable pricing based on cart weight or total.
6
- Version: 1.6.2
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
10
  Domain Path: /languages/
11
- Tested up to: 4.6.1
12
 
13
  Copyright 2016 WP Desk Ltd.
14
 
@@ -67,6 +67,13 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
67
 
68
  add_action( 'woocommerce_after_shipping_rate', array( $this, 'woocommerce_after_shipping_rate' ), 10, 2 );
69
 
 
 
 
 
 
 
 
70
  global $woocommerce_wpml;
71
 
72
  if ( isset( $woocommerce_wpml ) ) {
@@ -83,6 +90,66 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
83
 
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  public function admin_notices() {
87
  if ( is_plugin_active( 'woocommerce-active-payments/activepayments.php' ) ) {
88
  $plugin_activepayments = get_plugin_data( WP_PLUGIN_DIR . '/woocommerce-active-payments/activepayments.php' );
@@ -136,7 +203,7 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
136
  }
137
 
138
  function enqueue_admin_scripts() {
139
- wp_enqueue_style( 'flexible-shipping-admin', $this->getPluginUrl() . 'assets/css/admin.css' );
140
  }
141
 
142
  function enqueue_scripts() {
@@ -182,6 +249,13 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
182
  }
183
  }
184
 
 
 
 
 
 
 
 
185
  public function flexible_shipping_value_in_currency_aelia( $value ) {
186
  $aelia = WC_Aelia_CurrencySwitcher::instance();
187
  $aelia_settings = WC_Aelia_CurrencySwitcher::settings();
@@ -257,5 +331,23 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
257
  }
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  $_GLOBALS['woocommerce_flexible_shipping'] = new WPDesk_Flexible_Shipping_Free_Plugin();
261
  }
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipping methods in WooCommerce and enable pricing based on cart weight or total.
6
+ Version: 1.7
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
10
  Domain Path: /languages/
11
+ Tested up to: 4.7
12
 
13
  Copyright 2016 WP Desk Ltd.
14
 
67
 
68
  add_action( 'woocommerce_after_shipping_rate', array( $this, 'woocommerce_after_shipping_rate' ), 10, 2 );
69
 
70
+ add_action( 'flexible_shipping_method_rate_id', array( $this, 'flexible_shipping_method_rate_id' ), 9999999, 2 );
71
+
72
+ add_filter( 'woocommerce_shipping_chosen_method', array( $this, 'woocommerce_shipping_chosen_method' ), 10, 2);
73
+
74
+ add_action( 'init', array( $this, 'init_polylang') );
75
+ add_action( 'admin_init', array( $this, 'init_wpml') );
76
+
77
  global $woocommerce_wpml;
78
 
79
  if ( isset( $woocommerce_wpml ) ) {
90
 
91
  }
92
 
93
+ function woocommerce_shipping_chosen_method( $method, $available_methods ) {
94
+ $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods', array() );
95
+ if ( isset( $chosen_shipping_methods[0] ) ) {
96
+ foreach ($available_methods as $available_method ) {
97
+ if ( $available_method->id ==
98
+ $chosen_shipping_methods[0] ) {
99
+ $method = $available_method->id;
100
+ break;
101
+ }
102
+ }
103
+ }
104
+ return $method;
105
+ }
106
+
107
+ function init_polylang() {
108
+ if ( function_exists( 'pll_register_string' ) ) {
109
+ $all_shipping_methods = WC()->shipping()->get_shipping_methods();
110
+ if ( empty( $all_shipping_methods ) ) {
111
+ $all_shipping_methods = WC()->shipping()->load_shipping_methods();
112
+ }
113
+ $flexible_shipping = $all_shipping_methods['flexible_shipping'];
114
+ $flexible_shipping_rates = $flexible_shipping->get_all_rates();
115
+ foreach ( $flexible_shipping_rates as $flexible_shipping_rate ) {
116
+ if ( isset( $flexible_shipping_rate['method_title'] ) ) {
117
+ pll_register_string( $flexible_shipping_rate['method_title'], $flexible_shipping_rate['method_title'], __( 'Flexible Shipping', 'flexible-shipping' ) );
118
+ }
119
+ if ( isset( $flexible_shipping_rate['method_description'] ) ) {
120
+ pll_register_string( $flexible_shipping_rate['method_description'], $flexible_shipping_rate['method_description'], __( 'Flexible Shipping', 'flexible-shipping' ) );
121
+ }
122
+ if ( isset( $flexible_shipping_rate['method_free_shipping_label'] ) ) {
123
+ pll_register_string( $flexible_shipping_rate['method_free_shipping_label'], $flexible_shipping_rate['method_free_shipping_label'], __( 'Flexible Shipping', 'flexible-shipping' ) );
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ function init_wpml() {
130
+ if ( function_exists( 'icl_register_string' ) ) {
131
+ $icl_language_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_bloginfo('language');
132
+ $all_shipping_methods = WC()->shipping()->get_shipping_methods();
133
+ if ( empty( $all_shipping_methods ) ) {
134
+ $all_shipping_methods = WC()->shipping()->load_shipping_methods();
135
+ }
136
+ $flexible_shipping = $all_shipping_methods['flexible_shipping'];
137
+ $flexible_shipping_rates = $flexible_shipping->get_all_rates();
138
+ foreach ( $flexible_shipping_rates as $flexible_shipping_rate ) {
139
+ if ( isset( $flexible_shipping_rate['method_title'] ) ) {
140
+ icl_register_string( 'flexible-shipping', $flexible_shipping_rate['method_title'], $flexible_shipping_rate['method_title'], false, $icl_language_code );
141
+ }
142
+ if ( isset( $flexible_shipping_rate['method_description'] ) ) {
143
+ icl_register_string( 'flexible-shipping', $flexible_shipping_rate['method_description'], $flexible_shipping_rate['method_description'], false, $icl_language_code );
144
+ }
145
+ if ( isset( $flexible_shipping_rate['method_free_shipping_label'] ) ) {
146
+ icl_register_string( 'flexible-shipping', $flexible_shipping_rate['method_free_shipping_label'], $flexible_shipping_rate['method_free_shipping_label'], false, $icl_language_code );
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+
153
  public function admin_notices() {
154
  if ( is_plugin_active( 'woocommerce-active-payments/activepayments.php' ) ) {
155
  $plugin_activepayments = get_plugin_data( WP_PLUGIN_DIR . '/woocommerce-active-payments/activepayments.php' );
203
  }
204
 
205
  function enqueue_admin_scripts() {
206
+ wp_enqueue_style( 'flexible-shipping-admin', $this->getPluginUrl() . 'assets/css/admin.css', array(), '1.4' );
207
  }
208
 
209
  function enqueue_scripts() {
249
  }
250
  }
251
 
252
+ public function flexible_shipping_method_rate_id( $method_id, array $shipping_method ) {
253
+ if ( isset( $shipping_method['id_for_shipping'] ) && $shipping_method['id_for_shipping'] != '' ) {
254
+ $method_id = $shipping_method['id_for_shipping'];
255
+ }
256
+ return $method_id;
257
+ }
258
+
259
  public function flexible_shipping_value_in_currency_aelia( $value ) {
260
  $aelia = WC_Aelia_CurrencySwitcher::instance();
261
  $aelia_settings = WC_Aelia_CurrencySwitcher::settings();
331
  }
332
  }
333
 
334
+ if ( !function_exists( 'wpdesk__' ) ) {
335
+ function wpdesk__( $text, $domain ) {
336
+ if ( function_exists( 'icl_sw_filters_gettext' ) ) {
337
+ return icl_sw_filters_gettext( $text, $text, $domain, $text );
338
+ }
339
+ if ( function_exists( 'pll__' ) ) {
340
+ return pll__( $text );
341
+ }
342
+ return __( $text, $domain );
343
+ }
344
+ }
345
+
346
+ if ( !function_exists( 'wpdesk__e' ) ) {
347
+ function wpdesk__e( $text, $domain ) {
348
+ echo wpdesk__( $text, $domain );
349
+ }
350
+ }
351
+
352
  $_GLOBALS['woocommerce_flexible_shipping'] = new WPDesk_Flexible_Shipping_Free_Plugin();
353
  }
languages/flexible-shipping-pl_PL.mo CHANGED
Binary file
languages/flexible-shipping-pl_PL.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Flexible Shipping\n"
4
- "POT-Creation-Date: 2016-09-27 17:23+0200\n"
5
- "PO-Revision-Date: 2016-09-27 17:25+0200\n"
6
- "Last-Translator: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
7
  "Language-Team: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
8
  "Language: pl_PL\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.8.7\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: flexible-shipping.php\n"
15
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
@@ -33,23 +33,25 @@ msgstr ""
33
  msgid "An unknown error occurred"
34
  msgstr "Wystąpił nieznany błąd"
35
 
36
- #: classes/inspire/plugin4.php:387 flexible-shipping.php:147
37
  msgid "Settings"
38
  msgstr "Ustawienia"
39
 
40
- #: classes/inspire/plugin4.php:388 flexible-shipping.php:148
41
  msgid "Docs"
42
  msgstr "Docs"
43
 
44
- #: classes/inspire/plugin4.php:389 flexible-shipping.php:149
45
  msgid "Support"
46
  msgstr "Wsparcie"
47
 
48
  #. Plugin Name of the plugin/theme
49
  #: classes/settings-flexible-shipping.php:14
50
  #: classes/settings-flexible-shipping.php:28
51
- #: classes/settings-shipping-method-form.php:29 classes/shipping_method.php:24
52
  #: classes/shipping_method.php:25 classes/shipping_method.php:43
 
 
53
  msgid "Flexible Shipping"
54
  msgstr "Flexible Shipping"
55
 
@@ -59,7 +61,7 @@ msgid "See how to %sconfigure Flexible Shipping%s."
59
  msgstr "Zobacz jak %sskonfigurować Flexible Shipping%s."
60
 
61
  #: classes/settings-flexible-shipping.php:19
62
- #: classes/settings-shipping-method-form.php:20 classes/shipping_method.php:34
63
  msgid "Enable/Disable"
64
  msgstr "Włącz/Wyłącz"
65
 
@@ -100,37 +102,41 @@ msgstr "Wybierz klasę wysyłkową"
100
  #: classes/settings-shipping-method-form.php:15
101
  #, php-format
102
  msgid ""
103
- "%sAdd integrations%s with Paczkomaty InPost, eNadawca Poczta Polska, Paczka "
104
- "w Ruchu."
105
  msgstr ""
106
- "%sDodaj integracje%s z Paczkomaty InPost, eNadawca Poczta Polska, Paczka w "
107
- "Ruchu."
108
 
109
- #: classes/settings-shipping-method-form.php:23 classes/shipping_method.php:36
 
 
 
 
110
  msgid "Enable this shipping method"
111
  msgstr "Włącz tę metodę wysyłki"
112
 
113
- #: classes/settings-shipping-method-form.php:26
114
  msgid "Method Title"
115
  msgstr "Tytuł metody"
116
 
117
- #: classes/settings-shipping-method-form.php:28 classes/shipping_method.php:42
118
  msgid "This controls the title which the user sees during checkout."
119
  msgstr "Tytuł, który widzi użytkownik podczas składania zamówienia."
120
 
121
- #: classes/settings-shipping-method-form.php:35
122
  msgid "Method Description"
123
  msgstr "Opis"
124
 
125
- #: classes/settings-shipping-method-form.php:37
126
  msgid "This controls method description which the user sees during checkout."
127
  msgstr "Opis, który widzi użytkownik podczas składania zamówienia."
128
 
129
- #: classes/settings-shipping-method-form.php:43
130
- msgid "Free shipping"
131
  msgstr "Darmowa wysyłka"
132
 
133
- #: classes/settings-shipping-method-form.php:46
134
  msgid ""
135
  "Enter a minimum order amount for free shipping. This will override the costs "
136
  "configured below."
@@ -138,37 +144,46 @@ msgstr ""
138
  "Wpisz minimalną kwotę zamówienia dla bezpłatnej wysyłki. Spowoduje to "
139
  "zastąpienie reguł skonfigurowanych poniżej."
140
 
141
- #: classes/settings-shipping-method-form.php:50
142
- msgid "Calculation method"
 
 
 
 
 
 
 
 
 
143
  msgstr "Metoda obliczania"
144
 
145
- #: classes/settings-shipping-method-form.php:52
146
  msgid ""
147
  "Select how rules will be calculated. If you choose \"sum\" the rules order "
148
  "is important."
149
  msgstr ""
150
  "Wybierz jak będą obliczane reguły. Dla sumy, kolejność reguł ma znaczenie."
151
 
152
- #: classes/settings-shipping-method-form.php:55
153
  msgid "Sum"
154
  msgstr "Suma"
155
 
156
- #: classes/settings-shipping-method-form.php:58
157
  #: classes/views/html-shipping-method-settings.php:21
158
  msgid "Visibility"
159
  msgstr "Wyświetlanie"
160
 
161
- #: classes/settings-shipping-method-form.php:61
162
  #: classes/views/html-shipping-method-settings.php:54
163
  msgid "Show only for logged in users"
164
  msgstr "Pokaż tylko dla zalogowanych użytkowników"
165
 
166
- #: classes/settings-shipping-method-form.php:64
167
  #: classes/views/html-shipping-method-settings.php:22
168
  msgid "Default"
169
  msgstr "Domyślnie"
170
 
171
- #: classes/settings-shipping-method-form.php:67
172
  msgid ""
173
  "Check the box to set this option as the default selected choice on the cart "
174
  "page."
@@ -176,29 +191,29 @@ msgstr ""
176
  "Zaznacz, aby ustawić tę metodę wysyłki jako domyślną przy składaniu "
177
  "zamówienia."
178
 
179
- #: classes/settings-shipping-method-form.php:70
180
  #: classes/views/html-shipping-method-settings.php:23
181
  msgid "Integration"
182
  msgstr "Integracja"
183
 
184
- #: classes/settings-shipping-method-form.php:72
185
  msgid "Select integration. "
186
  msgstr "Wybierz integrację. "
187
 
188
- #: classes/settings-shipping-method-form.php:75
189
  #: classes/views/html-shipping-method-rules.php:7
190
  msgid "None"
191
  msgstr "Brak"
192
 
193
- #: classes/settings-shipping-method-form.php:82
194
  msgid "Rules"
195
  msgstr "Reguły"
196
 
197
- #: classes/settings-shipping-method-form.php:99
198
  msgid "Shipping Zone"
199
  msgstr "Strefa wysyłki"
200
 
201
- #: classes/settings-shipping-method-form.php:111
202
  #, php-format
203
  msgid "See how to %sconfigure shipping methods%s."
204
  msgstr "Zobacz jak %sskonfigurować metody wysyłki %s."
@@ -207,34 +222,34 @@ msgstr "Zobacz jak %sskonfigurować metody wysyłki %s."
207
  msgid "Shipping Title"
208
  msgstr "Tytuł"
209
 
210
- #: classes/shipping_method.php:107
211
  #: classes/views/html-shipping-method-rules.php:241
212
  msgid "Add New"
213
  msgstr "Dodaj nową"
214
 
215
- #: classes/shipping_method.php:317
216
  msgid "New Shipping Method"
217
  msgstr "Nowa metoda wysyłki"
218
 
219
- #: classes/shipping_method.php:320
220
  msgid "Edit Shipping Method"
221
  msgstr "Edytuj metodę wysyłki"
222
 
223
- #: classes/shipping_method.php:330 classes/shipping_method.php:367
224
  #, php-format
225
  msgid "Shipping method %s added."
226
  msgstr "Metoda wysyłki dodana: %s."
227
 
228
- #: classes/shipping_method.php:351
229
  #, php-format
230
  msgid "Shipping method %s deleted."
231
  msgstr "Metoda wysyłki usunięta: %s."
232
 
233
- #: classes/shipping_method.php:354
234
  msgid "Shipping method not found."
235
  msgstr "Metoda wysyłki nie znaleziona."
236
 
237
- #: classes/shipping_method.php:379
238
  #, php-format
239
  msgid "Shipping method %s updated."
240
  msgstr "Metoda wysyłki zaktualizowana: %s."
@@ -306,7 +321,7 @@ msgid "Are you sure?"
306
  msgstr "Na pewno?"
307
 
308
  #: classes/views/html-shipping-method-rules.php:232
309
- #: classes/views/html-shipping-method-settings.php:96
310
  msgid "Shipping Zones"
311
  msgstr "Strefy wysyłki"
312
 
@@ -319,8 +334,8 @@ msgid "Enabled"
319
  msgstr "Włączona"
320
 
321
  #: classes/views/html-shipping-method-settings.php:24
322
- msgid "Action"
323
- msgstr "Akcje"
324
 
325
  #: classes/views/html-shipping-method-settings.php:47
326
  #: classes/views/html-shipping-method-settings.php:54
@@ -332,11 +347,7 @@ msgstr "tak"
332
  msgid "Show for all users"
333
  msgstr "Pokaż dla wszystkich użytkowników"
334
 
335
- #: classes/views/html-shipping-method-settings.php:71
336
- msgid "Delete"
337
- msgstr "Usuń"
338
-
339
- #: classes/views/html-shipping-method-settings.php:80
340
  msgid ""
341
  "Drag and drop the above shipping methods to control their display order. "
342
  "Confirm by clicking Save changes button below."
@@ -344,23 +355,27 @@ msgstr ""
344
  "Przeciągnij i upuść metody wysyłki aby ustawić ich kolejność wyświetlania. "
345
  "Potwierdź przez kliknięcie przycisku Zapisz zmiany poniżej."
346
 
347
- #: flexible-shipping.php:80
 
 
 
 
348
  msgid ""
349
  "Flexible Shipping requires at least version 2.7 of Active Payments plugin."
350
  msgstr ""
351
  "Flexible Shipping wymaga wtyczki Aktywne płatności w wersji co najmniej 2.7."
352
 
353
- #: flexible-shipping.php:91
354
  msgid "Flexible Shipping requires at least version 1.2 of eNadawca plugin."
355
  msgstr "Flexible Shipping wymaga wtyczki eNadawca w wersji co najmniej 1.2."
356
 
357
- #: flexible-shipping.php:102
358
  msgid ""
359
  "Flexible Shipping requires at least version 1.1 of Paczka w Ruchu plugin."
360
  msgstr ""
361
  "Flexible Shipping wymaga wtyczki Paczka w Ruchu w wersji co najmniej 1.1."
362
 
363
- #: flexible-shipping.php:110
364
  #, php-format
365
  msgid ""
366
  "You are using WooCommerce Flexible Shipping below 1.4. Please deactivate it "
@@ -371,7 +386,7 @@ msgstr ""
371
  "Wyłącz go na %sstronie wtyczek%s. Przeczytaj o dużej zmianie we Flexible "
372
  "Shipping na %snaszym blogu →%s"
373
 
374
- #: flexible-shipping.php:213
375
  #, php-format
376
  msgid "Redirecting. If page not redirects click %s here %s."
377
  msgstr ""
@@ -398,6 +413,31 @@ msgstr "WP Desk"
398
  msgid "https://www.wpdesk.net/"
399
  msgstr "https://www.wpdesk.pl/"
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  #~ msgid ""
402
  #~ "If you need more advanced rules based on shipping classes, product/item "
403
  #~ "count or adding additional handling/insurance fees make sure to check "
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Flexible Shipping\n"
4
+ "POT-Creation-Date: 2016-12-13 14:52+0100\n"
5
+ "PO-Revision-Date: 2016-12-13 14:52+0100\n"
6
+ "Last-Translator: Piotr Jabłonowski <piotr.jablonowski@inspirelabs.pl>\n"
7
  "Language-Team: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
8
  "Language: pl_PL\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.8.11\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: flexible-shipping.php\n"
15
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
33
  msgid "An unknown error occurred"
34
  msgstr "Wystąpił nieznany błąd"
35
 
36
+ #: classes/inspire/plugin4.php:387 flexible-shipping.php:211
37
  msgid "Settings"
38
  msgstr "Ustawienia"
39
 
40
+ #: classes/inspire/plugin4.php:388 flexible-shipping.php:212
41
  msgid "Docs"
42
  msgstr "Docs"
43
 
44
+ #: classes/inspire/plugin4.php:389 flexible-shipping.php:213
45
  msgid "Support"
46
  msgstr "Wsparcie"
47
 
48
  #. Plugin Name of the plugin/theme
49
  #: classes/settings-flexible-shipping.php:14
50
  #: classes/settings-flexible-shipping.php:28
51
+ #: classes/settings-shipping-method-form.php:35 classes/shipping_method.php:24
52
  #: classes/shipping_method.php:25 classes/shipping_method.php:43
53
+ #: flexible-shipping.php:101 flexible-shipping.php:104
54
+ #: flexible-shipping.php:107
55
  msgid "Flexible Shipping"
56
  msgstr "Flexible Shipping"
57
 
61
  msgstr "Zobacz jak %sskonfigurować Flexible Shipping%s."
62
 
63
  #: classes/settings-flexible-shipping.php:19
64
+ #: classes/settings-shipping-method-form.php:26 classes/shipping_method.php:34
65
  msgid "Enable/Disable"
66
  msgstr "Włącz/Wyłącz"
67
 
102
  #: classes/settings-shipping-method-form.php:15
103
  #, php-format
104
  msgid ""
105
+ "%sAdd integrations%s with DHL, Paczkomaty InPost, eNadawca Poczta Polska, "
106
+ "Paczka w Ruchu."
107
  msgstr ""
108
+ "%sDodaj integrację%s z DHL, Paczkomaty InPost, eNadawca Poczta Polska, "
109
+ "Paczka w Ruchu."
110
 
111
+ #: classes/settings-shipping-method-form.php:19 classes/shipping_method.php:571
112
+ msgid "Free"
113
+ msgstr "Bezpłatnie"
114
+
115
+ #: classes/settings-shipping-method-form.php:29 classes/shipping_method.php:36
116
  msgid "Enable this shipping method"
117
  msgstr "Włącz tę metodę wysyłki"
118
 
119
+ #: classes/settings-shipping-method-form.php:32
120
  msgid "Method Title"
121
  msgstr "Tytuł metody"
122
 
123
+ #: classes/settings-shipping-method-form.php:34 classes/shipping_method.php:42
124
  msgid "This controls the title which the user sees during checkout."
125
  msgstr "Tytuł, który widzi użytkownik podczas składania zamówienia."
126
 
127
+ #: classes/settings-shipping-method-form.php:41
128
  msgid "Method Description"
129
  msgstr "Opis"
130
 
131
+ #: classes/settings-shipping-method-form.php:43
132
  msgid "This controls method description which the user sees during checkout."
133
  msgstr "Opis, który widzi użytkownik podczas składania zamówienia."
134
 
135
+ #: classes/settings-shipping-method-form.php:54
136
+ msgid "Free Shipping"
137
  msgstr "Darmowa wysyłka"
138
 
139
+ #: classes/settings-shipping-method-form.php:57
140
  msgid ""
141
  "Enter a minimum order amount for free shipping. This will override the costs "
142
  "configured below."
144
  "Wpisz minimalną kwotę zamówienia dla bezpłatnej wysyłki. Spowoduje to "
145
  "zastąpienie reguł skonfigurowanych poniżej."
146
 
147
+ #: classes/settings-shipping-method-form.php:61
148
+ msgid "Free Shipping Label"
149
+ msgstr "Etykieta darmowej wysyłki"
150
+
151
+ #: classes/settings-shipping-method-form.php:64
152
+ msgid "Enter additional label for shipping when free shipping available."
153
+ msgstr ""
154
+ "Wpisz dodatkową etykietę, która zostanie wyświetlona dla darmowej wysyłki."
155
+
156
+ #: classes/settings-shipping-method-form.php:73
157
+ msgid "Calculation Method"
158
  msgstr "Metoda obliczania"
159
 
160
+ #: classes/settings-shipping-method-form.php:75
161
  msgid ""
162
  "Select how rules will be calculated. If you choose \"sum\" the rules order "
163
  "is important."
164
  msgstr ""
165
  "Wybierz jak będą obliczane reguły. Dla sumy, kolejność reguł ma znaczenie."
166
 
167
+ #: classes/settings-shipping-method-form.php:78
168
  msgid "Sum"
169
  msgstr "Suma"
170
 
171
+ #: classes/settings-shipping-method-form.php:81
172
  #: classes/views/html-shipping-method-settings.php:21
173
  msgid "Visibility"
174
  msgstr "Wyświetlanie"
175
 
176
+ #: classes/settings-shipping-method-form.php:84
177
  #: classes/views/html-shipping-method-settings.php:54
178
  msgid "Show only for logged in users"
179
  msgstr "Pokaż tylko dla zalogowanych użytkowników"
180
 
181
+ #: classes/settings-shipping-method-form.php:87
182
  #: classes/views/html-shipping-method-settings.php:22
183
  msgid "Default"
184
  msgstr "Domyślnie"
185
 
186
+ #: classes/settings-shipping-method-form.php:90
187
  msgid ""
188
  "Check the box to set this option as the default selected choice on the cart "
189
  "page."
191
  "Zaznacz, aby ustawić tę metodę wysyłki jako domyślną przy składaniu "
192
  "zamówienia."
193
 
194
+ #: classes/settings-shipping-method-form.php:93
195
  #: classes/views/html-shipping-method-settings.php:23
196
  msgid "Integration"
197
  msgstr "Integracja"
198
 
199
+ #: classes/settings-shipping-method-form.php:95
200
  msgid "Select integration. "
201
  msgstr "Wybierz integrację. "
202
 
203
+ #: classes/settings-shipping-method-form.php:98
204
  #: classes/views/html-shipping-method-rules.php:7
205
  msgid "None"
206
  msgstr "Brak"
207
 
208
+ #: classes/settings-shipping-method-form.php:109
209
  msgid "Rules"
210
  msgstr "Reguły"
211
 
212
+ #: classes/settings-shipping-method-form.php:130
213
  msgid "Shipping Zone"
214
  msgstr "Strefa wysyłki"
215
 
216
+ #: classes/settings-shipping-method-form.php:142
217
  #, php-format
218
  msgid "See how to %sconfigure shipping methods%s."
219
  msgstr "Zobacz jak %sskonfigurować metody wysyłki %s."
222
  msgid "Shipping Title"
223
  msgstr "Tytuł"
224
 
225
+ #: classes/shipping_method.php:108
226
  #: classes/views/html-shipping-method-rules.php:241
227
  msgid "Add New"
228
  msgstr "Dodaj nową"
229
 
230
+ #: classes/shipping_method.php:333
231
  msgid "New Shipping Method"
232
  msgstr "Nowa metoda wysyłki"
233
 
234
+ #: classes/shipping_method.php:336
235
  msgid "Edit Shipping Method"
236
  msgstr "Edytuj metodę wysyłki"
237
 
238
+ #: classes/shipping_method.php:346 classes/shipping_method.php:387
239
  #, php-format
240
  msgid "Shipping method %s added."
241
  msgstr "Metoda wysyłki dodana: %s."
242
 
243
+ #: classes/shipping_method.php:370
244
  #, php-format
245
  msgid "Shipping method %s deleted."
246
  msgstr "Metoda wysyłki usunięta: %s."
247
 
248
+ #: classes/shipping_method.php:373
249
  msgid "Shipping method not found."
250
  msgstr "Metoda wysyłki nie znaleziona."
251
 
252
+ #: classes/shipping_method.php:399
253
  #, php-format
254
  msgid "Shipping method %s updated."
255
  msgstr "Metoda wysyłki zaktualizowana: %s."
321
  msgstr "Na pewno?"
322
 
323
  #: classes/views/html-shipping-method-rules.php:232
324
+ #: classes/views/html-shipping-method-settings.php:99
325
  msgid "Shipping Zones"
326
  msgstr "Strefy wysyłki"
327
 
334
  msgstr "Włączona"
335
 
336
  #: classes/views/html-shipping-method-settings.php:24
337
+ msgid "Select all"
338
+ msgstr "Zaznacz wszystkie"
339
 
340
  #: classes/views/html-shipping-method-settings.php:47
341
  #: classes/views/html-shipping-method-settings.php:54
347
  msgid "Show for all users"
348
  msgstr "Pokaż dla wszystkich użytkowników"
349
 
350
+ #: classes/views/html-shipping-method-settings.php:77
 
 
 
 
351
  msgid ""
352
  "Drag and drop the above shipping methods to control their display order. "
353
  "Confirm by clicking Save changes button below."
355
  "Przeciągnij i upuść metody wysyłki aby ustawić ich kolejność wyświetlania. "
356
  "Potwierdź przez kliknięcie przycisku Zapisz zmiany poniżej."
357
 
358
+ #: classes/views/html-shipping-method-settings.php:82
359
+ msgid "Remove selected"
360
+ msgstr "Usuń zaznaczone"
361
+
362
+ #: flexible-shipping.php:144
363
  msgid ""
364
  "Flexible Shipping requires at least version 2.7 of Active Payments plugin."
365
  msgstr ""
366
  "Flexible Shipping wymaga wtyczki Aktywne płatności w wersji co najmniej 2.7."
367
 
368
+ #: flexible-shipping.php:155
369
  msgid "Flexible Shipping requires at least version 1.2 of eNadawca plugin."
370
  msgstr "Flexible Shipping wymaga wtyczki eNadawca w wersji co najmniej 1.2."
371
 
372
+ #: flexible-shipping.php:166
373
  msgid ""
374
  "Flexible Shipping requires at least version 1.1 of Paczka w Ruchu plugin."
375
  msgstr ""
376
  "Flexible Shipping wymaga wtyczki Paczka w Ruchu w wersji co najmniej 1.1."
377
 
378
+ #: flexible-shipping.php:174
379
  #, php-format
380
  msgid ""
381
  "You are using WooCommerce Flexible Shipping below 1.4. Please deactivate it "
386
  "Wyłącz go na %sstronie wtyczek%s. Przeczytaj o dużej zmianie we Flexible "
387
  "Shipping na %snaszym blogu →%s"
388
 
389
+ #: flexible-shipping.php:304
390
  #, php-format
391
  msgid "Redirecting. If page not redirects click %s here %s."
392
  msgstr ""
413
  msgid "https://www.wpdesk.net/"
414
  msgstr "https://www.wpdesk.pl/"
415
 
416
+ #~ msgid "Minimum Order Amount"
417
+ #~ msgstr "Minimalna wartość zamówienia"
418
+
419
+ #~ msgid "Free shipping label"
420
+ #~ msgstr "Etykieta darmowej wysyłki"
421
+
422
+ #~ msgid "Calculation method"
423
+ #~ msgstr "Metoda obliczania"
424
+
425
+ #~ msgid "Free shipping"
426
+ #~ msgstr "Darmowa wysyłka"
427
+
428
+ #~ msgid ""
429
+ #~ "%sAdd integrations%s with Paczkomaty InPost, eNadawca Poczta Polska, "
430
+ #~ "Paczka w Ruchu."
431
+ #~ msgstr ""
432
+ #~ "%sDodaj integracje%s z Paczkomaty InPost, eNadawca Poczta Polska, Paczka "
433
+ #~ "w Ruchu."
434
+
435
+ #~ msgid "Action"
436
+ #~ msgstr "Akcje"
437
+
438
+ #~ msgid "Delete"
439
+ #~ msgstr "Usuń"
440
+
441
  #~ msgid ""
442
  #~ "If you need more advanced rules based on shipping classes, product/item "
443
  #~ "count or adding additional handling/insurance fees make sure to check "
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk, swoboda, jablonowski
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart total, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.0
6
- Tested up to: 4.6.1
7
- Stable tag: 1.6.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -42,6 +42,7 @@ These are just a few examples. The possibilities are probably endless ;) We desc
42
  * Show selected shipping methods only for logged in users
43
  * Integrations (see below for details)
44
  * Compatible with WooCommerce 2.6 Shipping Zones (see below for details)
 
45
 
46
  = PRO Features =
47
 
@@ -53,6 +54,7 @@ These are just a few examples. The possibilities are probably endless ;) We desc
53
  * Cancelling a rule (if the rule is matched it is removed from available shipping methods at the checkout)
54
  * Additional calculation methods (sum, lowest cost, highest cost)
55
  * Maximum shipping cost per shipping method
 
56
 
57
  [Upgrade to PRO Now &rarr;](https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/)
58
 
@@ -124,6 +126,12 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
124
 
125
  == Changelog ==
126
 
 
 
 
 
 
 
127
  = 1.6.2 - 2016-10-26 =
128
  * Tweaked support for the default "Rest of the world" shipping zone
129
  * Added support for "Network activated" WooCommerce on Multisite installations
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart total, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.0
6
+ Tested up to: 4.7
7
+ Stable tag: 1.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
42
  * Show selected shipping methods only for logged in users
43
  * Integrations (see below for details)
44
  * Compatible with WooCommerce 2.6 Shipping Zones (see below for details)
45
+ * WPML and Polylang support
46
 
47
  = PRO Features =
48
 
54
  * Cancelling a rule (if the rule is matched it is removed from available shipping methods at the checkout)
55
  * Additional calculation methods (sum, lowest cost, highest cost)
56
  * Maximum shipping cost per shipping method
57
+ * Coupons support for free shipping
58
 
59
  [Upgrade to PRO Now &rarr;](https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/)
60
 
126
 
127
  == Changelog ==
128
 
129
+ = 1.7 - 2016-12-14 =
130
+ * Added WPML and Polylang support
131
+ * Added custom "free shipping" label
132
+ * Removed decrecated enable/disable for main shipping method
133
+ * Fixed choosing default shipping method in the checkout
134
+
135
  = 1.6.2 - 2016-10-26 =
136
  * Tweaked support for the default "Rest of the world" shipping zone
137
  * Added support for "Network activated" WooCommerce on Multisite installations