Saphali Woocommerce Russian - Version 1.8.9

Version Description

  • .
Download this release

Release Info

Developer Saphali
Plugin Icon wp plugin Saphali Woocommerce Russian
Version 1.8.9
Comparing to
See all releases

Code changes from version 1.8.8 to 1.8.9

Files changed (2) hide show
  1. readme.txt +5 -2
  2. saphali-woocommerce-lite.php +31 -25
readme.txt CHANGED
@@ -5,8 +5,8 @@ Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
5
  Donate link: https://money.yandex.ru/to/410011651211340
6
  Tags: woocommerce, woo commerce russian, russian ruble, ukrainian hryvnia, mod, manadger filds checkout
7
  Requires at least: WP 3.3 or higher & WooCommerce 1.6.6 or higher
8
- Tested up to: 5.4
9
- Stable tag: 1.8.8
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -76,6 +76,9 @@ define('SAPHALI_LITE_SYMBOL', 0 );
76
 
77
  == Changelog ==
78
 
 
 
 
79
  = 1.8.8 =
80
  * Fix символа в WC 4 в отчетах.
81
 
5
  Donate link: https://money.yandex.ru/to/410011651211340
6
  Tags: woocommerce, woo commerce russian, russian ruble, ukrainian hryvnia, mod, manadger filds checkout
7
  Requires at least: WP 3.3 or higher & WooCommerce 1.6.6 or higher
8
+ Tested up to: 5.5
9
+ Stable tag: 1.8.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
76
 
77
  == Changelog ==
78
 
79
+ = 1.8.9 =
80
+ * Смена условия вывода методов доставки в настройках.
81
+
82
  = 1.8.8 =
83
  * Fix символа в WC 4 в отчетах.
84
 
saphali-woocommerce-lite.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Saphali Woocommerce Russian
4
  Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
5
  Description: Saphali Woocommerce Russian - это бесплатный вордпресс плагин, который добавляет набор дополнений к интернет-магазину на Woocommerce.
6
- Version: 1.8.8
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  Text Domain: saphali-woocommerce-lite
10
  Domain Path: /languages
11
  WC requires at least: 1.6.6
12
- WC tested up to: 4.0
13
  */
14
 
15
 
@@ -35,12 +35,13 @@ WC tested up to: 4.0
35
 
36
  // Подключение валюты и локализации
37
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
38
- define('SAPHALI_LITE_VERSION', '1.8.8' );
39
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
40
  class saphali_lite {
41
  var $email_order_id;
42
  var $fieldss;
43
  var $unuque = array();
 
44
  var $column_count_saphali;
45
  function __construct() {
46
  if ( version_compare( WOOCOMMERCE_VERSION, '2.2.0', '<' ) || version_compare( WOOCOMMERCE_VERSION, '2.5.0', '>' ) )
@@ -67,7 +68,7 @@ WC tested up to: 4.0
67
  add_filter( 'woocommerce_order_formatted_billing_address', array($this,'formatted_billing_address') , 10 , 2);
68
  add_filter( 'woocommerce_order_formatted_shipping_address', array($this,'formatted_shipping_address') , 10 , 2);
69
 
70
- if( !( isset($_GET['tab']) && isset($_GET['page']) ) || $_GET['page'] != 'woocommerce_saphali_s_l' && $_GET['tab'] !=1 ) {
71
  // Hook in
72
  add_filter( 'woocommerce_checkout_fields' , array($this,'saphali_custom_override_checkout_fields') );
73
  add_filter( 'wp' , array($this,'wp') );
@@ -383,7 +384,7 @@ public function woocommerce_checkout_posted_data( $data ) {
383
  function corect_shipping_method_filds () {
384
  var selected_s_method = typeof jQuery("input.shipping_method:checked, input.shipping_method[type=\"hidden\"], select.shipping_method").val() != 'undefined' ? jQuery("input.shipping_method:checked, input.shipping_method[type=\"hidden\"], select.shipping_method").val().split(":")[0] : '';
385
  jQuery.each($skeys, function(i,e){
386
- if( jQuery.inArray( selected_s_method, e ) >= 0 ) {
387
  jQuery("#" + i + "_field").show('slow');
388
  } else {
389
  jQuery("#" + i + "_field").hide('slow');
@@ -699,7 +700,7 @@ public function woocommerce_checkout_posted_data( $data ) {
699
  function admin_enqueue_scripts_page_saphali() {
700
  global $woocommerce;
701
  $plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );
702
- if( isset($_GET['page']) && $_GET['page'] == 'woocommerce_saphali_s_l' && (isset($_GET['tab']) && $_GET['tab'] ==1) )
703
  wp_enqueue_script( 'tablednd', $plugin_url. '/js/jquery.tablednd.0.5.js', array('jquery'), $woocommerce->version );
704
  }
705
  function woocommerce_saphali_page_s_l () {
@@ -709,19 +710,15 @@ public function woocommerce_checkout_posted_data( $data ) {
709
  Настройки Saphali WC
710
  </h2>
711
  <ul class="subsubsub">
712
-
713
- <li><a href="admin.php?page=woocommerce_saphali_s_l" <?php if(empty($_GET["tab"])) echo 'class="current"';?>><span color="red">Дополнительная информация</span></a> | </li>
714
- <li><a href="admin.php?page=woocommerce_saphali_s_l&tab=1" <?php if(!empty($_GET["tab"]) && $_GET["tab"] == 1) echo 'class="current"';?>>Управление полями</a> | </li>
715
- <li><a href="admin.php?page=woocommerce_saphali_s_l&tab=2" <?php if(!empty($_GET["tab"]) && $_GET["tab"] == 2) echo 'class="current"';?>>Число колонок в каталоге</a></li>
716
-
717
  </ul>
718
- <?php if( empty($_GET["tab"]) ) {?>
719
- <div class="clear"></div>
720
- <h2 class="woo-nav-tab-wrapper">Дополнительная информация</h2>
721
- <?php include_once (SAPHALI_PLUGIN_DIR_PATH . 'go_pro.php'); } elseif($_GET["tab"] == 2) {?>
722
- <div class="clear"></div>
723
- <h2 class="woo-nav-tab-wrapper">Число колонок в каталоге товаров и в рубриках</h2>
724
- <?php include_once (SAPHALI_PLUGIN_DIR_PATH . 'count-column.php'); } elseif($_GET["tab"] == 1) {
725
  global $woocommerce;
726
  remove_filter( 'woocommerce_checkout_fields' , 'woo_customize_checkout_fields' );
727
  if ( empty( $woocommerce->checkout ) ) {
@@ -750,6 +747,10 @@ public function woocommerce_checkout_posted_data( $data ) {
750
  }
751
  else $f = $woocommerce->checkout;
752
  $global_f_checkout_fields = $f->checkout_fields;
 
 
 
 
753
  if($_POST){
754
  if(@$_POST["reset"] != 'All') {
755
  // Управление новыми полями
@@ -999,7 +1000,7 @@ public function woocommerce_checkout_posted_data( $data ) {
999
  <option value="0"<?php if( isset($value['shipping_method']) && ( in_array('0', $value['shipping_method']) || empty($value['shipping_method']) ) || !isset($value['shipping_method']) ) echo 'selected';?>>Все</option>
1000
  <?php
1001
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1002
- if ( $shipping->enabled != 'yes' ) continue;
1003
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php echo $shipping->title ? $shipping->title: $shipping->method_title; ?></option><?php
1004
  }
1005
  ?>
@@ -1130,7 +1131,7 @@ public function woocommerce_checkout_posted_data( $data ) {
1130
  <option value="0" <?php if( isset($value['shipping_method']) && ( in_array('0', $value['shipping_method']) || empty($value['shipping_method']) ) || !isset($value['shipping_method']) ) echo 'selected';?>>Все</option>
1131
  <?php
1132
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1133
- if ( $shipping->enabled != 'yes' ) continue;
1134
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php echo $shipping->title ? $shipping->title: $shipping->method_title; ?></option><?php
1135
  }
1136
  ?>
@@ -1237,7 +1238,7 @@ public function woocommerce_checkout_posted_data( $data ) {
1237
  </tr>
1238
  </tbody>
1239
  </table><br />
1240
- <input type="submit" class="button alignleft" value="Сохранить"/>
1241
  </form>
1242
  <form action="" method="post">
1243
  <input type="hidden" name="reset" value="All"/>
@@ -1320,7 +1321,7 @@ public function woocommerce_checkout_posted_data( $data ) {
1320
  <option selected value="0">Все</option>\
1321
  <?php
1322
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1323
- if ( $shipping->enabled != 'yes' ) continue;
1324
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php $st = $shipping->title ? $shipping->title: $shipping->method_title; echo str_replace("'", "\\'", $st); ?></option><?php
1325
  }
1326
  ?>\
@@ -1348,7 +1349,7 @@ public function woocommerce_checkout_posted_data( $data ) {
1348
  <option selected value="0">Все</option>\
1349
  <?php
1350
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1351
- if ( $shipping->enabled != 'yes' ) continue;
1352
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php $st = $shipping->title ? $shipping->title: $shipping->method_title; echo str_replace("'", "\\'", $st); ?></option><?php
1353
  }
1354
  ?>\
@@ -1393,8 +1394,13 @@ public function woocommerce_checkout_posted_data( $data ) {
1393
  });
1394
  });
1395
  </script>
1396
- <?php } ?>
1397
-
 
 
 
 
 
1398
  </div>
1399
  <?php
1400
  }
3
  Plugin Name: Saphali Woocommerce Russian
4
  Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
5
  Description: Saphali Woocommerce Russian - это бесплатный вордпресс плагин, который добавляет набор дополнений к интернет-магазину на Woocommerce.
6
+ Version: 1.8.9
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  Text Domain: saphali-woocommerce-lite
10
  Domain Path: /languages
11
  WC requires at least: 1.6.6
12
+ WC tested up to: 4.5
13
  */
14
 
15
 
35
 
36
  // Подключение валюты и локализации
37
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
38
+ define('SAPHALI_LITE_VERSION', '1.8.9' );
39
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
40
  class saphali_lite {
41
  var $email_order_id;
42
  var $fieldss;
43
  var $unuque = array();
44
+ var $locale_tmp;
45
  var $column_count_saphali;
46
  function __construct() {
47
  if ( version_compare( WOOCOMMERCE_VERSION, '2.2.0', '<' ) || version_compare( WOOCOMMERCE_VERSION, '2.5.0', '>' ) )
68
  add_filter( 'woocommerce_order_formatted_billing_address', array($this,'formatted_billing_address') , 10 , 2);
69
  add_filter( 'woocommerce_order_formatted_shipping_address', array($this,'formatted_shipping_address') , 10 , 2);
70
 
71
+ if( !( isset($_GET['page']) && $_GET['page'] == 'woocommerce_saphali_s_l' ) ) {
72
  // Hook in
73
  add_filter( 'woocommerce_checkout_fields' , array($this,'saphali_custom_override_checkout_fields') );
74
  add_filter( 'wp' , array($this,'wp') );
384
  function corect_shipping_method_filds () {
385
  var selected_s_method = typeof jQuery("input.shipping_method:checked, input.shipping_method[type=\"hidden\"], select.shipping_method").val() != 'undefined' ? jQuery("input.shipping_method:checked, input.shipping_method[type=\"hidden\"], select.shipping_method").val().split(":")[0] : '';
386
  jQuery.each($skeys, function(i,e){
387
+ if( jQuery.inArray( selected_s_method, e ) >= 0 || e.filter(function(v){ return selected_s_method.indexOf(v) === 0; }).length > 0 ) {
388
  jQuery("#" + i + "_field").show('slow');
389
  } else {
390
  jQuery("#" + i + "_field").hide('slow');
700
  function admin_enqueue_scripts_page_saphali() {
701
  global $woocommerce;
702
  $plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );
703
+ if( isset($_GET['page']) && $_GET['page'] == 'woocommerce_saphali_s_l' )
704
  wp_enqueue_script( 'tablednd', $plugin_url. '/js/jquery.tablednd.0.5.js', array('jquery'), $woocommerce->version );
705
  }
706
  function woocommerce_saphali_page_s_l () {
710
  Настройки Saphali WC
711
  </h2>
712
  <ul class="subsubsub">
713
+ <li><a href="admin.php?page=woocommerce_saphali_s_l" <?php if(empty($_GET["tab"])) echo 'class="current"';?> >Управление полями</a> | </li>
714
+ <li><a href="admin.php?page=woocommerce_saphali_s_l&tab=2" <?php if(!empty($_GET["tab"]) && $_GET["tab"] == 2) echo 'class="current"';?>>Число колонок в каталоге</a> | </li>
715
+ <li><a href="admin.php?page=woocommerce_saphali_s_l&tab=1" <?php if(!empty($_GET["tab"]) && $_GET["tab"] == 1) echo 'class="current"';?>><span color="red">Дополнительная информация</span></a></li>
 
 
716
  </ul>
717
+ <?php if(empty($_GET["tab"])) {
718
+ $this->locale_tmp = get_locale();
719
+ if( !empty($this->locale_tmp) && $this->locale_tmp != 'en_US') {
720
+ switch_to_locale('en_US');
721
+ }
 
 
722
  global $woocommerce;
723
  remove_filter( 'woocommerce_checkout_fields' , 'woo_customize_checkout_fields' );
724
  if ( empty( $woocommerce->checkout ) ) {
747
  }
748
  else $f = $woocommerce->checkout;
749
  $global_f_checkout_fields = $f->checkout_fields;
750
+
751
+ if( !empty($this->locale_tmp) && $this->locale_tmp != 'en_US') {
752
+ switch_to_locale($this->locale_tmp);
753
+ }
754
  if($_POST){
755
  if(@$_POST["reset"] != 'All') {
756
  // Управление новыми полями
1000
  <option value="0"<?php if( isset($value['shipping_method']) && ( in_array('0', $value['shipping_method']) || empty($value['shipping_method']) ) || !isset($value['shipping_method']) ) echo 'selected';?>>Все</option>
1001
  <?php
1002
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1003
+ if ( $shipping->enabled == 'no' ) continue;
1004
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php echo $shipping->title ? $shipping->title: $shipping->method_title; ?></option><?php
1005
  }
1006
  ?>
1131
  <option value="0" <?php if( isset($value['shipping_method']) && ( in_array('0', $value['shipping_method']) || empty($value['shipping_method']) ) || !isset($value['shipping_method']) ) echo 'selected';?>>Все</option>
1132
  <?php
1133
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1134
+ if ( $shipping->enabled == 'no' ) continue;
1135
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php echo $shipping->title ? $shipping->title: $shipping->method_title; ?></option><?php
1136
  }
1137
  ?>
1238
  </tr>
1239
  </tbody>
1240
  </table><br />
1241
+ <input type="submit" class="button alignleft" value="<?php _e('Save') ?>"/>
1242
  </form>
1243
  <form action="" method="post">
1244
  <input type="hidden" name="reset" value="All"/>
1321
  <option selected value="0">Все</option>\
1322
  <?php
1323
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1324
+ if ( $shipping->enabled == 'no' ) continue;
1325
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php $st = $shipping->title ? $shipping->title: $shipping->method_title; echo str_replace("'", "\\'", $st); ?></option><?php
1326
  }
1327
  ?>\
1349
  <option selected value="0">Все</option>\
1350
  <?php
1351
  foreach ( $woocommerce->shipping->get_shipping_methods() as $act_id => $shipping ) {
1352
+ if ( $shipping->enabled == 'no' ) continue;
1353
  ?><option value="<?php echo $act_id; ?>" <?php if(isset($value['shipping_method']) && in_array($act_id, $value['shipping_method']) ) echo 'selected';?>><?php $st = $shipping->title ? $shipping->title: $shipping->method_title; echo str_replace("'", "\\'", $st); ?></option><?php
1354
  }
1355
  ?>\
1394
  });
1395
  });
1396
  </script>
1397
+ <?php } elseif( $_GET["tab"] == 1) { ?>
1398
+ <div class="clear"></div>
1399
+ <h2 class="woo-nav-tab-wrapper">Дополнительная информация</h2>
1400
+ <?php include_once (SAPHALI_PLUGIN_DIR_PATH . 'go_pro.php'); } elseif($_GET["tab"] == 2) { ?>
1401
+ <div class="clear"></div>
1402
+ <h2 class="woo-nav-tab-wrapper">Число колонок в каталоге товаров и в рубриках</h2>
1403
+ <?php include_once (SAPHALI_PLUGIN_DIR_PATH . 'count-column.php'); } ?>
1404
  </div>
1405
  <?php
1406
  }