Saphali Woocommerce Russian - Version 1.7.1

Version Description

  • WC 3.x.x , WC.
Download this release

Release Info

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

Code changes from version 1.7.0 to 1.7.1

Files changed (2) hide show
  1. readme.txt +5 -2
  2. saphali-woocommerce-lite.php +20 -16
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: 4.7
9
- Stable tag: 1.7.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -72,6 +72,9 @@ define('SAPHALI_LITE_SYMBOL', 0 );
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 1.7.0 =
76
  * Добавлен функционал, который позволяет соотнести поле к методам оплаты. Напр., будет полезно, если некоторые поля не требуется выводить при оплате каким-то методом оплаты, но нужны при оплате через какой-то другой.
77
 
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: 4.8
9
+ Stable tag: 1.7.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
72
 
73
  == Changelog ==
74
 
75
+ = 1.7.1 =
76
+ * В версии WC 3.x.x отображение добавленных полей, которые отсутствуют по умолчанию в WC.
77
+
78
  = 1.7.0 =
79
  * Добавлен функционал, который позволяет соотнести поле к методам оплаты. Напр., будет полезно, если некоторые поля не требуется выводить при оплате каким-то методом оплаты, но нужны при оплате через какой-то другой.
80
 
saphali-woocommerce-lite.php CHANGED
@@ -3,12 +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.7.0
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  Text Domain: saphali-woocommerce-lite
10
  Domain Path: /languages
11
-
 
12
  */
13
 
14
 
@@ -34,7 +35,7 @@ Domain Path: /languages
34
 
35
  // Подключение валюты и локализации
36
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
37
- define('SAPHALI_LITE_VERSION', '1.7.0' );
38
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
39
  class saphali_lite {
40
  var $email_order_id;
@@ -152,7 +153,7 @@ Domain Path: /languages
152
  if(! isset($this->fieldss) )
153
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
154
  $fieldss = $this->fieldss;
155
-
156
  foreach(array('billing', 'shipping') as $type) {
157
  foreach($fieldss[$type] as $key => $value) {
158
  if(isset($value['payment_method'])) {
@@ -228,6 +229,7 @@ Domain Path: /languages
228
  foreach($fieldss[$type] as $key => $value) {
229
  if(isset($value['payment_method'])) {
230
  $pm_k_remove = array();
 
231
  foreach($value['payment_method'] as $k => $v) {
232
  if($v === '0') {
233
  $pm_k_remove[] = $k;
@@ -250,6 +252,7 @@ Domain Path: /languages
250
  var selected_p_method = jQuery("input[name=\"payment_method\"]:checked").val();
251
  jQuery.each($keys, function(i,e){
252
  if( jQuery.inArray( selected_p_method, e ) >= 0 ) {
 
253
  jQuery("#" + i + "_field").show('slow');
254
  } else {
255
  jQuery("#" + i + "_field").hide('slow');
@@ -582,6 +585,7 @@ Domain Path: /languages
582
  }
583
  }
584
  else $f = $woocommerce->checkout;
 
585
  if($_POST){
586
  if(@$_POST["reset"] != 'All') {
587
  // Управление новыми полями
@@ -646,7 +650,7 @@ Domain Path: /languages
646
  unset($_POST["order"]["new_fild"]);
647
  }
648
  //END
649
- $filds = $f->checkout_fields;
650
 
651
  if(is_array($filds["billing"])) {
652
  if(!is_array($addFild["billing"])) $addFild["billing"] = array();
@@ -655,7 +659,7 @@ Domain Path: /languages
655
 
656
  foreach($filds["billing"] as $key_post => $value_post) {
657
 
658
- if( !isset($f->checkout_fields["billing"][$key_post]['type']) && $filds["billing"][$key_post]['type'] != 'select' && $filds["billing"][$key_post]['type'] != 'checkbox' && $filds["billing"][$key_post]['type'] != 'textarea' ) unset($filds["billing"][$key_post]['type'], $value_post["type"]);
659
 
660
 
661
  if(@$filds["billing"][$key_post]['public'] != 'on') {
@@ -682,7 +686,7 @@ Domain Path: /languages
682
  $filds["shipping"] = array_merge($filds["shipping"] , $_POST["shipping"], $addFild["shipping"]);
683
  foreach($filds["shipping"] as $key_post => $value_post) {
684
 
685
- if( !isset($f->checkout_fields["shipping"][$key_post]['type']) ) unset($filds["shipping"][$key_post]['type'], $value_post["type"]);
686
 
687
  if($filds["shipping"][$key_post]['public'] != 'on') {
688
  $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = false;
@@ -818,9 +822,9 @@ Domain Path: /languages
818
 
819
  $checkout_fields = get_option('woocommerce_saphali_filds');
820
 
821
- if( isset($checkout_fields["billing"]) && is_array($checkout_fields["billing"])) $f->checkout_fields["billing"] = $checkout_fields["billing"];
822
  if( isset($f) )
823
- foreach($f->checkout_fields["billing"] as $key => $value) {
824
 
825
  $public = 'public';
826
  if( !version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
@@ -935,9 +939,9 @@ Domain Path: /languages
935
  </tfoot>
936
  <tbody id="the-list" class="myTable">
937
  <?php $count = 0;
938
- if(isset($checkout_fields["shipping"]) && is_array($checkout_fields["shipping"])) $f->checkout_fields["shipping"] = $checkout_fields["shipping"];
939
- if( isset( $f->checkout_fields["shipping"] ) )
940
- foreach($f->checkout_fields["shipping"] as $key => $value) {
941
  $public = 'public';
942
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
943
  if( isset( $checkout_fields["shipping"][$key] ) ) $value[$public] = $checkout_fields["shipping"][$key][$public];
@@ -1034,9 +1038,9 @@ Domain Path: /languages
1034
  </tfoot>
1035
  <tbody id="the-list" class="myTable">
1036
  <?php $count = 0;
1037
- if(isset($checkout_fields["order"]) && is_array($checkout_fields["order"])) $f->checkout_fields["order"] = $checkout_fields["order"];
1038
- if(isset($f->checkout_fields["order"]) )
1039
- foreach($f->checkout_fields["order"] as $key => $value) {
1040
  $public = 'public';
1041
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
1042
  if( isset( $checkout_fields["order"][$key] ) ) $value[$public] = $checkout_fields["order"][$key][$public];
@@ -1478,7 +1482,7 @@ Domain Path: /languages
1478
  if(! isset($this->fieldss) )
1479
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1480
  $fieldss = $this->fieldss;
1481
-
1482
  if(is_array($fieldss))
1483
  $_fields = $fieldss["billing"];
1484
  if( isset($_fields) && is_array($_fields) )
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.7.1
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: 3.2.2
13
  */
14
 
15
 
35
 
36
  // Подключение валюты и локализации
37
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
38
+ define('SAPHALI_LITE_VERSION', '1.7.1' );
39
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
40
  class saphali_lite {
41
  var $email_order_id;
153
  if(! isset($this->fieldss) )
154
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
155
  $fieldss = $this->fieldss;
156
+ $keys = array();
157
  foreach(array('billing', 'shipping') as $type) {
158
  foreach($fieldss[$type] as $key => $value) {
159
  if(isset($value['payment_method'])) {
229
  foreach($fieldss[$type] as $key => $value) {
230
  if(isset($value['payment_method'])) {
231
  $pm_k_remove = array();
232
+ if(is_array($value['payment_method']))
233
  foreach($value['payment_method'] as $k => $v) {
234
  if($v === '0') {
235
  $pm_k_remove[] = $k;
252
  var selected_p_method = jQuery("input[name=\"payment_method\"]:checked").val();
253
  jQuery.each($keys, function(i,e){
254
  if( jQuery.inArray( selected_p_method, e ) >= 0 ) {
255
+ if( ! ( jQuery("#billing_platelshik_is_grpl").is(':checked') && ( i == 'billing_gruzopoluch' || i == 'billing_gruzopoluch_okpo') ) )
256
  jQuery("#" + i + "_field").show('slow');
257
  } else {
258
  jQuery("#" + i + "_field").hide('slow');
585
  }
586
  }
587
  else $f = $woocommerce->checkout;
588
+ $global_f_checkout_fields = $f->checkout_fields;
589
  if($_POST){
590
  if(@$_POST["reset"] != 'All') {
591
  // Управление новыми полями
650
  unset($_POST["order"]["new_fild"]);
651
  }
652
  //END
653
+ $filds = $global_f_checkout_fields;
654
 
655
  if(is_array($filds["billing"])) {
656
  if(!is_array($addFild["billing"])) $addFild["billing"] = array();
659
 
660
  foreach($filds["billing"] as $key_post => $value_post) {
661
 
662
+ if( !isset($global_f_checkout_fields["billing"][$key_post]['type']) && $filds["billing"][$key_post]['type'] != 'select' && $filds["billing"][$key_post]['type'] != 'checkbox' && $filds["billing"][$key_post]['type'] != 'textarea' ) unset($filds["billing"][$key_post]['type'], $value_post["type"]);
663
 
664
 
665
  if(@$filds["billing"][$key_post]['public'] != 'on') {
686
  $filds["shipping"] = array_merge($filds["shipping"] , $_POST["shipping"], $addFild["shipping"]);
687
  foreach($filds["shipping"] as $key_post => $value_post) {
688
 
689
+ if( !isset($global_f_checkout_fields["shipping"][$key_post]['type']) ) unset($filds["shipping"][$key_post]['type'], $value_post["type"]);
690
 
691
  if($filds["shipping"][$key_post]['public'] != 'on') {
692
  $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = false;
822
 
823
  $checkout_fields = get_option('woocommerce_saphali_filds');
824
 
825
+ if( isset($checkout_fields["billing"]) && is_array($checkout_fields["billing"])) $global_f_checkout_fields["billing"] = $checkout_fields["billing"];
826
  if( isset($f) )
827
+ foreach($global_f_checkout_fields["billing"] as $key => $value) {
828
 
829
  $public = 'public';
830
  if( !version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
939
  </tfoot>
940
  <tbody id="the-list" class="myTable">
941
  <?php $count = 0;
942
+ if(isset($checkout_fields["shipping"]) && is_array($checkout_fields["shipping"])) $global_f_checkout_fields["shipping"] = $checkout_fields["shipping"];
943
+ if( isset( $global_f_checkout_fields["shipping"] ) )
944
+ foreach($global_f_checkout_fields["shipping"] as $key => $value) {
945
  $public = 'public';
946
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
947
  if( isset( $checkout_fields["shipping"][$key] ) ) $value[$public] = $checkout_fields["shipping"][$key][$public];
1038
  </tfoot>
1039
  <tbody id="the-list" class="myTable">
1040
  <?php $count = 0;
1041
+ if(isset($checkout_fields["order"]) && is_array($checkout_fields["order"])) $global_f_checkout_fields["order"] = $checkout_fields["order"];
1042
+ if(isset($global_f_checkout_fields["order"]) )
1043
+ foreach($global_f_checkout_fields["order"] as $key => $value) {
1044
  $public = 'public';
1045
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
1046
  if( isset( $checkout_fields["order"][$key] ) ) $value[$public] = $checkout_fields["order"][$key][$public];
1482
  if(! isset($this->fieldss) )
1483
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1484
  $fieldss = $this->fieldss;
1485
+ $__fields = array();
1486
  if(is_array($fieldss))
1487
  $_fields = $fieldss["billing"];
1488
  if( isset($_fields) && is_array($_fields) )