Saphali Woocommerce Russian - Version 1.3.6.1

Version Description

  • ( ).
Download this release

Release Info

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

Code changes from version 1.3.5 to 1.3.6.1

Files changed (2) hide show
  1. readme.txt +17 -3
  2. saphali-woocommerce-lite.php +111 -136
readme.txt CHANGED
@@ -5,9 +5,9 @@ Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
5
  Donate link: http://saphali.com/
6
  Tags: woocommerce, woo commerce russian, russian ruble, ukrainian hryvnia, mod, manadger filds checkout
7
  Requires at least: 3.3 or higher
8
- Tested up to: 3.6
9
- Stable tag: 1.3.5
10
- Version: 1.3.5
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -61,6 +61,15 @@ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интерк
61
  3. Управление количеством колонок в каталоге товаров и рубриках.
62
 
63
  == Changelog ==
 
 
 
 
 
 
 
 
 
64
  = 1.3.5 =
65
  * Добавлена функция вывода дополнительных полей в письмах и при просмотре заказа покупателем.
66
 
@@ -130,6 +139,11 @@ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интерк
130
 
131
  == Upgrade Notice ==
132
 
 
 
 
 
 
133
  = 1.3.2.1 =
134
  * Мелкие исправления по локализации под WooCommerce
135
 
5
  Donate link: http://saphali.com/
6
  Tags: woocommerce, woo commerce russian, russian ruble, ukrainian hryvnia, mod, manadger filds checkout
7
  Requires at least: 3.3 or higher
8
+ Tested up to: 3.6.1
9
+ Stable tag: 1.3.6.1
10
+ Version: 1.3.6.1
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
61
  3. Управление количеством колонок в каталоге товаров и рубриках.
62
 
63
  == Changelog ==
64
+
65
+ = 1.3.6.1 =
66
+ * Исправлена ошибка отображения дополнительных полей заполненных покупателем (в письме и в заказе).
67
+
68
+ = 1.3.6 =
69
+ * Устранена ошибка не сохранения некоторых атрибутов поля (напр, поле "Название компании" теперь можно отмечать как обязательное, указывать текст по умолчанию).
70
+ * Добавленные произвольные поля теперь можно сортировать вместе со стандартными полями (устранена разрозненность сортировки полей, которые есть по умолчанию, и тех, которые добавлены по надобности).
71
+ * Исправлены некритичные ошибки.
72
+
73
  = 1.3.5 =
74
  * Добавлена функция вывода дополнительных полей в письмах и при просмотре заказа покупателем.
75
 
139
 
140
  == Upgrade Notice ==
141
 
142
+ = 1.3.6 =
143
+ * Устранена ошибка не сохранения некоторых атрибутов поля (напр, поле "Название компании" теперь можно отмечать как обязательное, указывать текст по умолчанию).
144
+ * Добавленные произвольные поля теперь можно сортировать вместе со стандартными полями (устранена разрозненность сортировки полей, которые есть по умолчанию, и тех, которые добавлены по надобности).
145
+ * Исправлены некритичные ошибки.
146
+
147
  = 1.3.2.1 =
148
  * Мелкие исправления по локализации под WooCommerce
149
 
saphali-woocommerce-lite.php CHANGED
@@ -3,7 +3,7 @@
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.3.5
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  */
@@ -242,93 +242,80 @@ Author URI: http://saphali.com/
242
  }
243
  //END
244
  $filds = $f->checkout_fields;
245
- if(is_array($filds["billing"]))
 
 
 
 
 
246
  foreach($filds["billing"] as $key_post => $value_post) {
247
- $filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post] = $value_post;
248
- if($_POST["billing"][$key_post]['public'] != 'on') {
249
- $filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post]["public"] = false;
 
 
 
250
  $fild_remove_filter["billing"][] = $key_post;
251
- } else {$filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post]["public"] = true;}
252
-
253
- $_POST["billing"][$key_post]['required'] = ($_POST["billing"][$key_post]['required'] == 'on') ? true : false ;
254
-
255
- $_POST["billing"][$key_post]['clear'] = $bool_clear = ($_POST["billing"][$key_post]['clear'] == 'on') ? true : false ;
256
-
257
  foreach($value_post as $k_post=> $v_post){
258
- if( $_POST["billing"][$key_post][$k_post] != $v_post && isset($_POST["billing"][$key_post][$k_post]) ) {
259
- $filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post][$k_post] = $_POST["billing"][$key_post][$k_post];
260
- }
261
- }
262
- if( $bool_clear ){
263
- $filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post]['clear'] = $bool_clear;
264
- } elseif(isset($filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post]['clear'])) {
265
- unset($filds_new["billing"][$_POST["billing"][$key_post]["order"]][$key_post]['clear']);
266
  }
 
 
267
  unset($_POST["billing"][$key_post]);
268
  }
269
- if(is_array($filds["shipping"]))
 
 
 
 
 
270
  foreach($filds["shipping"] as $key_post => $value_post) {
271
- $filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post] = $value_post;
272
-
273
- if($_POST["shipping"][$key_post]['public'] != 'on') {
274
- $filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post]["public"] = false;
275
- $fild_remove_filter["shipping"][] = $key_post;
276
- } else {$filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post]["public"] = true;}
277
-
278
- $_POST["shipping"][$key_post]['clear'] = $bool_clear = ($_POST["shipping"][$key_post]['clear'] == 'on') ? true : false ;
279
 
280
- $_POST["shipping"][$key_post]['required'] = ($_POST["shipping"][$key_post]['required'] == 'on') ? true : false ;
281
 
 
 
 
 
 
282
  foreach($value_post as $k_post=> $v_post){
283
- if( $_POST["shipping"][$key_post][$k_post] != $v_post && isset($_POST["shipping"][$key_post][$k_post]) ) {
284
- $filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post][$k_post] = $_POST["shipping"][$key_post][$k_post];
285
- }
286
- }
287
- if( $bool_clear ){
288
- $filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post]['clear'] = $bool_clear;
289
- } elseif(isset($filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post]['clear'])) {
290
- unset($filds_new["shipping"][$_POST["shipping"][$key_post]["order"]][$key_post]['clear']);
291
  }
 
292
  unset($_POST["shipping"][$key_post]);
293
  }
294
- if(is_array($filds["order"]))
 
 
 
 
 
295
  foreach($filds["order"] as $key_post => $value_post) {
296
- $filds_new["order"][$_POST["order"][$key_post]["order"]][$key_post] = $value_post;
297
- if($_POST["order"][$key_post]['public'] != 'on') {
298
- $filds_new["order"][$_POST["order"][$key_post]["order"]][$key_post]["public"] = false;
299
- $fild_remove_filter["order"][] = $key_post;
300
- } else {$filds_new["order"][$_POST["order"][$key_post]["order"]][$key_post]["public"] = true;}
301
-
302
 
303
- $_POST["order"][$key_post]['required'] = ($_POST["order"][$key_post]['required'] == 'on') ? true : false ;
304
-
 
 
305
 
306
  foreach($value_post as $k_post=> $v_post){
307
- if( $_POST["order"][$key_post][$k_post] != $v_post && isset($_POST["order"][$key_post][$k_post]) ) {
308
- $filds_new["order"][$_POST["order"][$key_post]["order"]][$key_post][$k_post] = $_POST["order"][$key_post][$k_post];
309
- }
310
  }
 
 
 
311
  unset($_POST["order"][$key_post]);
312
  }
313
- // Управление публикацией
314
- if(!empty($_POST["billing"])) {
315
- foreach($_POST["billing"] as $k_post => $v_post) {
316
- if($v_post["public"] != 'on' )
317
- $fild_remove_filter["billing"][] = $k_post;
318
- }
319
- }
320
- if(!empty($_POST["shipping"])) {
321
- foreach($_POST["shipping"] as $k_post => $v_post) {
322
- if($v_post["public"] != 'on' )
323
- $fild_remove_filter["shipping"][] = $k_post;
324
- }
325
- }
326
- if(!empty($_POST["order"])) {
327
- foreach($_POST["order"] as $k_post => $v_post) {
328
- if($v_post["public"] != 'on' )
329
- $fild_remove_filter["order"][] = $k_post;
330
- }
331
  }
 
332
  //END Управление публикацией
333
  $filds_finish["billing"] = $filds_finish["shipping"] = $filds_finish["order"] = array();
334
 
@@ -344,23 +331,7 @@ Author URI: http://saphali.com/
344
  if(isset($filds_new["order"][$i]))
345
  $filds_finish["order"] = $filds_finish["order"] + $filds_new["order"][$i];
346
  }
347
-
348
- if(is_array($_POST["billing"]))
349
- $filds_finish["billing"] = $filds_finish["billing"] + $_POST["billing"];
350
- if(is_array($_POST["shipping"]))
351
- $filds_finish["shipping"] = $filds_finish["shipping"] + $_POST["shipping"];
352
- if(is_array($_POST["order"]))
353
- $filds_finish["order"] = $filds_finish["order"] + $_POST["order"];
354
-
355
- if(is_array($addFild["billing"]))
356
- $filds_finish["billing"] = $filds_finish["billing"] + $addFild["billing"];
357
- if(is_array($addFild["shipping"]))
358
- $filds_finish["shipping"] = $filds_finish["shipping"] + $addFild["shipping"]+ $_POST["shipping"];
359
- if(is_array($addFild["order"]))
360
- $filds_finish["order"] = $filds_finish["order"] + $addFild["order"] + $_POST["order"];
361
-
362
-
363
-
364
  $filds_finish_filter = $filds_finish;
365
  if(is_array($fild_remove_filter["billing"])) {
366
  foreach($fild_remove_filter["billing"] as $v_filt){
@@ -433,7 +404,7 @@ Author URI: http://saphali.com/
433
  ?>
434
  <tr>
435
  <td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
436
- <td><input value='<?php echo $value['label']?>' type="text" name="billing[<?php echo $key?>][label]" /></td>
437
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="billing[<?php echo $key?>][placeholder]" /></td>
438
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="billing[<?php echo $key?>][clear]" /></td>
439
  <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
@@ -502,7 +473,7 @@ Author URI: http://saphali.com/
502
  ?>
503
  <tr>
504
  <td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
505
- <td><input value='<?php echo $value['label']?>' type="text" name="shipping[<?php echo $key?>][label]" /></td>
506
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
507
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
508
  <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
@@ -765,69 +736,73 @@ Author URI: http://saphali.com/
765
  }
766
  function woocommerce_get_customer_meta_fields_saphali() {
767
  $fieldss = get_option('woocommerce_saphali_filds_filters');
 
768
  $show_fields = $this->woocommerce_get_customer_meta_fields_saph_ed();
 
 
 
769
  if(is_array($fieldss)) {
770
  if(is_array($fieldss["billing"])) {
771
- $billing['fields'] = array();
772
- foreach($fieldss["billing"] as $key => $value) {
773
- if(isset($show_fields["billing"]['fields'][$key])) continue;
774
- $billing['fields'] = $billing['fields'] +
775
- array( $key => array(
776
- 'label' => $value["label"],
777
- 'show' => $value["public"],
778
- 'description' => ''
779
- )
780
- );
781
- }
782
  }
783
  if(is_array($fieldss["shipping"])) {
784
- $shipping['fields'] = array();
785
- foreach($fieldss["shipping"] as $key => $value) {
786
- if(isset($show_fields["shipping"]['fields'][$key])) continue;
787
- $shipping['fields'] = $shipping['fields'] +
788
- array( $key => array(
789
- 'label' => $value["label"],
790
- 'show' => $value["public"],
791
- 'description' => ''
792
- )
793
- );
794
- }
795
  }
796
  if(is_array($fieldss["order"])) {
797
- $orders['fields'] = array();
798
- foreach($fieldss["order"] as $key => $value) {
799
- if(isset($show_fields["order"]['fields'][$key])) continue;
800
- $orders['fields'] = $orders['fields'] +
801
- array( $key => array(
802
- 'label' => $value["label"],
803
- 'show' => $value["public"],
804
- 'description' => ''
805
- )
806
- );
807
- }
808
  }
809
  }
810
- if(!is_array($show_fields['billing']['fields'])) { $show_fields['billing']['fields'] = array(); }
811
- $show_fields['billing']['title'] = $show_fields['billing']['title'];
812
- if(isset($billing['billing']))
813
- $show_fields['billing'] = /* $show_fields['billing']['fields'] + */ $billing['fields'];
814
-
815
- if(!is_array($show_fields['shipping']['fields'])) { $show_fields['shipping']['fields'] = array(); }
816
- $show_fields['shipping']['title'] = $show_fields['shipping']['title'];
817
- if(isset($shipping['fields']))
818
- $show_fields['shipping'] = /* $show_fields['shipping']['fields'] + */ $shipping['fields'];
819
 
820
- if(!(@is_array($show_fields['order']['fields']))) {
821
-
822
- $show_fields['order']['fields'] = array();
823
-
824
- $show_fields['order']['title'] = 'Дополнительные поля';
 
 
 
 
 
 
 
 
825
 
 
 
 
826
  }
827
- if(isset($orders['fields']))
828
- $show_fields['order'] = /* $show_fields['order']['fields'] + */ $orders['fields'];
829
 
830
- return $show_fields;
831
  }
832
  function woocommerce_save_customer_meta_fields_saphali( $user_id ) {
833
  if ( ! current_user_can( 'manage_woocommerce' ) )
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.3.6.1
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  */
242
  }
243
  //END
244
  $filds = $f->checkout_fields;
245
+
246
+ if(is_array($filds["billing"])) {
247
+ if(!is_array($addFild["billing"])) $addFild["billing"] = array();
248
+ if(!is_array($_POST["billing"])) $_POST["billing"] = array();
249
+ $filds["billing"] = array_merge($filds["billing"] , $_POST["billing"], $addFild["billing"]);
250
+
251
  foreach($filds["billing"] as $key_post => $value_post) {
252
+
253
+ if( !isset($f->checkout_fields["billing"][$key_post]['type']) ) unset($filds["billing"][$key_post]['type'], $value_post["type"]);
254
+
255
+
256
+ if($filds["billing"][$key_post]['public'] != 'on') {
257
+ $filds_new["billing"][$filds["billing"][$key_post]["order"]][$key_post]["public"] = false;
258
  $fild_remove_filter["billing"][] = $key_post;
259
+ } else {$filds_new["billing"][$filds["billing"][$key_post]["order"]][$key_post]["public"] = true;}
260
+
261
+
 
 
 
262
  foreach($value_post as $k_post=> $v_post){
263
+ if( 'on' == $v_post ) {
264
+ $filds["billing"][$key_post][$k_post] = true;
265
+ } elseif(in_array($k_post, array('public','clear','required'))) { $filds["billing"][$key_post][$k_post] = false; if(!$filds["billing"][$key_post][$k_post] && $k_post == 'public') unset($filds["billing"][$key_post][$k_post]); }
 
 
 
 
 
266
  }
267
+ $filds_new["billing"][$filds["billing"][$key_post]["order"]][$key_post] = $value_post;
268
+
269
  unset($_POST["billing"][$key_post]);
270
  }
271
+
272
+ }
273
+ if(is_array($filds["shipping"])) {
274
+ if(!is_array($addFild["shipping"])) $addFild["shipping"] = array();
275
+ if(!is_array($_POST["shipping"])) $_POST["shipping"] = array();
276
+ $filds["shipping"] = array_merge($filds["shipping"] , $_POST["shipping"], $addFild["shipping"]);
277
  foreach($filds["shipping"] as $key_post => $value_post) {
 
 
 
 
 
 
 
 
278
 
279
+ if( !isset($f->checkout_fields["shipping"][$key_post]['type']) ) unset($filds["shipping"][$key_post]['type'], $value_post["type"]);
280
 
281
+ if($filds["shipping"][$key_post]['public'] != 'on') {
282
+ $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = false;
283
+ $fild_remove_filter["shipping"][] = $key_post;
284
+ } else {$filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = true;}
285
+
286
  foreach($value_post as $k_post=> $v_post){
287
+ if( 'on' == $v_post ) {
288
+ $filds["shipping"][$key_post][$k_post] = true;
289
+ } elseif(in_array($k_post, array('public','clear','required'))) { $filds["shipping"][$key_post][$k_post] = false; if(!$filds["shipping"][$key_post][$k_post] && $k_post == 'public') unset($filds["shipping"][$key_post][$k_post]); }
 
 
 
 
 
290
  }
291
+ $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post] = $value_post;
292
  unset($_POST["shipping"][$key_post]);
293
  }
294
+ }
295
+ if(is_array($filds["order"])) {
296
+ if(!is_array($addFild["order"])) $addFild["order"] = array();
297
+ if(!is_array($_POST["order"])) $_POST["order"] = array();
298
+ $filds["order"] = array_merge($filds["order"] , $_POST["order"], $addFild["order"]);
299
+
300
  foreach($filds["order"] as $key_post => $value_post) {
 
 
 
 
 
 
301
 
302
+ if($filds["order"][$key_post]['public'] != 'on') {
303
+ $filds_new["order"][$filds["order"][$key_post]["order"]][$key_post]["public"] = false;
304
+ $fild_remove_filter["order"][] = $key_post;
305
+ } else {$filds_new["order"][$filds["order"][$key_post]["order"]][$key_post]["public"] = true;}
306
 
307
  foreach($value_post as $k_post=> $v_post){
308
+ if( 'on' == $v_post ) {
309
+ $filds["order"][$key_post][$k_post] = true;
310
+ } elseif(in_array($k_post, array('public','clear','required'))) { $filds["order"][$key_post][$k_post] = false; if(!$filds["order"][$key_post][$k_post] && $k_post == 'public') unset($filds["order"][$key_post][$k_post]); }
311
  }
312
+
313
+ $filds_new["order"][$filds["order"][$key_post]["order"]][$key_post] = $value_post;
314
+
315
  unset($_POST["order"][$key_post]);
316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
+
319
  //END Управление публикацией
320
  $filds_finish["billing"] = $filds_finish["shipping"] = $filds_finish["order"] = array();
321
 
331
  if(isset($filds_new["order"][$i]))
332
  $filds_finish["order"] = $filds_finish["order"] + $filds_new["order"][$i];
333
  }
334
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  $filds_finish_filter = $filds_finish;
336
  if(is_array($fild_remove_filter["billing"])) {
337
  foreach($fild_remove_filter["billing"] as $v_filt){
404
  ?>
405
  <tr>
406
  <td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
407
+ <td><input value='<?php echo $value['label']?>' type="text" name="billing[<?php echo $key?>][label]" /><input value='<?php echo $value['type']?>' type="hidden" name="billing[<?php echo $key?>][type]" /></td>
408
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="billing[<?php echo $key?>][placeholder]" /></td>
409
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="billing[<?php echo $key?>][clear]" /></td>
410
  <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
473
  ?>
474
  <tr>
475
  <td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
476
+ <td><input value='<?php echo $value['label']?>' type="text" name="shipping[<?php echo $key?>][label]" /><input value='<?php echo $value['type']?>' type="hidden" name="shipping[<?php echo $key?>][type]" /></td>
477
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
478
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
479
  <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
736
  }
737
  function woocommerce_get_customer_meta_fields_saphali() {
738
  $fieldss = get_option('woocommerce_saphali_filds_filters');
739
+
740
  $show_fields = $this->woocommerce_get_customer_meta_fields_saph_ed();
741
+
742
+
743
+
744
  if(is_array($fieldss)) {
745
  if(is_array($fieldss["billing"])) {
746
+ $billing = array();
747
+ foreach($fieldss["billing"] as $key => $value) {
748
+ if(isset($show_fields["billing"]['fields'][$key])) continue;
749
+
750
+ foreach($value as $k_post=> $v_post){
751
+ if( 'on' == $v_post ) {
752
+ $value[$k_post] = true;
753
+ } elseif(in_array($k_post, array('public','clear','required'))) { $value[$k_post] = false; }
754
+ }
755
+ $billing = array_merge( $billing , array ($key => $value));
756
+ }
757
  }
758
  if(is_array($fieldss["shipping"])) {
759
+ $shipping = array();
760
+ foreach($fieldss["shipping"] as $key => $value) {
761
+ if(isset($show_fields["shipping"]['fields'][$key])) continue;
762
+ foreach($value as $k_post=> $v_post){
763
+ if( 'on' == $v_post ) {
764
+ $value[$k_post] = true;
765
+ } elseif(in_array($k_post, array('public','clear','required'))) { $value[$k_post] = false; }
766
+ }
767
+ $shipping = array_merge( $shipping , array ($key => $value));
768
+ }
 
769
  }
770
  if(is_array($fieldss["order"])) {
771
+ $orders = array();
772
+ foreach($fieldss["order"] as $key => $value) {
773
+ if(isset($show_fields["order"]['fields'][$key])) continue;
774
+ foreach($value as $k_post=> $v_post){
775
+ if( 'on' == $v_post ) {
776
+ $value[$k_post] = true;
777
+ } elseif(in_array($k_post, array('public','clear','required'))) { $value[$k_post] = false; }
778
+ }
779
+ $orders = array_merge( $orders , array ($key => $value));
780
+ }
 
781
  }
782
  }
 
 
 
 
 
 
 
 
 
783
 
784
+ if(!isset($show_fields['billing']['title'])) {
785
+ $_show_fields['billing']['title'] = $show_fields['billing']['title'];
786
+ }
787
+
788
+ if(isset($billing))
789
+ $_show_fields['billing'] = $billing;
790
+
791
+ if(!isset($show_fields['shipping']['title'])) {
792
+ $_show_fields['shipping']['title'] = $show_fields['shipping']['title'];
793
+ }
794
+
795
+ if(isset($shipping))
796
+ $_show_fields['shipping'] = $shipping;
797
 
798
+
799
+ if(!(@is_array($show_fields['order']['fields']))) {
800
+ $_show_fields['order']['title'] = 'Дополнительные поля';
801
  }
802
+ if(isset($orders))
803
+ $_show_fields['order'] = $orders;
804
 
805
+ return $_show_fields;
806
  }
807
  function woocommerce_save_customer_meta_fields_saphali( $user_id ) {
808
  if ( ! current_user_can( 'manage_woocommerce' ) )