Saphali Woocommerce Russian - Version 1.5.4

Version Description

  • WC 2.2.0 - 2.2.2.
Download this release

Release Info

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

Code changes from version 1.5.2 to 1.5.4

go_pro.php CHANGED
@@ -66,16 +66,6 @@
66
  <strong><a href="http://saphali.com/woocommerce-plugins/woocommerce-yandeks-dengi-dlya-organizacij">Подробнее</a></strong></p>
67
  </td>
68
  </tr>
69
- <tr>
70
- <td style="width:470px;height:19px;">
71
- <p>
72
- <strong>Woocommerce ROBOKASSA</strong></p>
73
- </td>
74
- <td style="width:153px;height:19px;">
75
- <p>
76
- <strong><a href="http://wordpress.org/plugins/robokassa-for-woocommerce/">Подробнее</a></strong></p>
77
- </td>
78
- </tr>
79
  <tr>
80
  <td style="width:470px;height:19px;">
81
  <p>
66
  <strong><a href="http://saphali.com/woocommerce-plugins/woocommerce-yandeks-dengi-dlya-organizacij">Подробнее</a></strong></p>
67
  </td>
68
  </tr>
 
 
 
 
 
 
 
 
 
 
69
  <tr>
70
  <td style="width:470px;height:19px;">
71
  <p>
languages/woocommerce-ru_RU.mo CHANGED
Binary file
languages/woocommerce-ru_RU.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: WooCommerce Lite|Standard v2\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2014-10-20 15:05+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -8339,3 +8339,6 @@ msgstr "БИК / Swift"
8339
 
8340
  msgid "BIC"
8341
  msgstr "БИК"
 
 
 
3
  "Project-Id-Version: WooCommerce Lite|Standard v2\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-10-22 18:53+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
8339
 
8340
  msgid "BIC"
8341
  msgstr "БИК"
8342
+
8343
+ msgid "IBAN"
8344
+ msgstr "ИНН"
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === Saphali Woocommerce Russian ===
2
  Contributors: Saphali
3
  Plugin Name: Saphali Woocommerce Russian
4
  Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
@@ -6,8 +6,8 @@ Donate link: http://saphali.com/vznos
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
8
  Tested up to: 4.0
9
- Stable tag: 1.5.2
10
- Version: 1.5.2
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -37,17 +37,11 @@ WooCommerce Russian! WooCommerce по-русски!
37
  <strong>ВНИМАНИЕ!</strong>
38
 
39
  Вы можете подключить к магазину все самые популярные российские и украинские платежные системы:
40
- QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интеркасса, PayPal для России и Украины, Z-payment, ChronoPay, ROBOKASSA!
41
  Подробнее о плагинах платежных шлюзов: http://saphali.com/wordpress/payment-gateways
42
 
43
  Другие русские плагины для интернет-магазина на Woocommerce смотрите в нашем каталоге http://saphali.com/wordpress/woocommerce-plugins
44
 
45
- <strong>Профессиональная версия - SAPHALI STANDARD</strong>
46
-
47
- Адаптирует интернет-магазин к использованию в странах СНГ, делает магазин более функциональным и удобным в использовании и администрировании, подключает все основные российские и украинские способы оплаты - <strong>QIWI, Приват24, LiqPay (прием оплаты с карт VISA и MasterCard), WebMoney, Яндекс.Деньги, PayPal для России и Украины, Z-payment, ROBOKASSA</strong>.
48
- Включает в себя: 8 платежных шлюзов Woocommerce и 8 новых добавленных особых функций для Woocommerce.
49
- Подробнее на сайте http://saphali.com/woocommerce-plugins/saphali-standard
50
-
51
  == Installation ==
52
 
53
  1. Разархивируйте содержимое zip файла в папку плагинов вашего сайта (wp-content/plugins/), используя вашу любимую FTP программу.
@@ -64,6 +58,12 @@ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интерк
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
 
67
  = 1.5.2 =
68
  * Изменения в связи с выходом Woocommerce 2.2.
69
 
1
+ === Saphali Woocommerce Russian ===
2
  Contributors: Saphali
3
  Plugin Name: Saphali Woocommerce Russian
4
  Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
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
8
  Tested up to: 4.0
9
+ Stable tag: 1.5.4
10
+ Version: 1.5.4
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
37
  <strong>ВНИМАНИЕ!</strong>
38
 
39
  Вы можете подключить к магазину все самые популярные российские и украинские платежные системы:
40
+ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интеркасса, PayPal для России и Украины, Z-payment, ChronoPay!
41
  Подробнее о плагинах платежных шлюзов: http://saphali.com/wordpress/payment-gateways
42
 
43
  Другие русские плагины для интернет-магазина на Woocommerce смотрите в нашем каталоге http://saphali.com/wordpress/woocommerce-plugins
44
 
 
 
 
 
 
 
45
  == Installation ==
46
 
47
  1. Разархивируйте содержимое zip файла в папку плагинов вашего сайта (wp-content/plugins/), используя вашу любимую FTP программу.
58
 
59
  == Changelog ==
60
 
61
+ = 1.5.4 =
62
+ * Исправлен вывод дополнительных полей для версий WC 2.2.0 - 2.2.2.
63
+
64
+ = 1.5.3 =
65
+ * Вывод дополнительных полей в профиле/аккаунте покупателя.
66
+
67
  = 1.5.2 =
68
  * Изменения в связи с выходом Woocommerce 2.2.
69
 
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.5.2
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  */
@@ -30,7 +30,7 @@ Author URI: http://saphali.com/
30
  ------------------------------------------------------------ */
31
  // Подключение валюты и локализации
32
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
33
- define('SAPHALI_LITE_VERSION', '1.5.2' );
34
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
35
  class saphali_lite {
36
  var $email_order_id;
@@ -56,9 +56,11 @@ Author URI: http://saphali.com/
56
  add_filter( 'woocommerce_order_formatted_billing_address', array($this,'formatted_billing_address') , 10 , 2);
57
  add_filter( 'woocommerce_order_formatted_shipping_address', array($this,'formatted_shipping_address') , 10 , 2);
58
 
59
- if(@$_GET['page'] != 'woocommerce_saphali_s_l' && @$_GET['tab'] !=1) {
60
  // Hook in
61
  add_filter( 'woocommerce_checkout_fields' , array($this,'saphali_custom_override_checkout_fields') );
 
 
62
  add_filter( 'woocommerce_billing_fields', array($this,'saphali_custom_billing_fields'), 10, 1 );
63
  add_filter( 'woocommerce_shipping_fields', array($this,'saphali_custom_shipping_fields'), 10, 1 );
64
  add_filter( 'woocommerce_default_address_fields', array($this,'woocommerce_default_address_fields'), 10, 1 );
@@ -75,6 +77,13 @@ Author URI: http://saphali.com/
75
  add_filter( 'woocommerce_currency_symbol', array($this,'add_inr_currency_symbol') , 1, 2 );
76
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'checkout_update_order_meta' ), 10, 2 );
77
  }
 
 
 
 
 
 
 
78
  public function checkout_update_order_meta( $order_id, $posted ) {
79
  if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
80
  $billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
@@ -86,6 +95,21 @@ Author URI: http://saphali.com/
86
  }
87
  }
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
  public function woocommerce_admin_order_totals_after_shipping($id) {
91
  if( apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) == 'RUB' ) {
@@ -489,7 +513,8 @@ Author URI: http://saphali.com/
489
 
490
  $checkout_fields = get_option('woocommerce_saphali_filds');
491
 
492
- if(is_array($checkout_fields["billing"])) $f->checkout_fields["billing"] = $checkout_fields["billing"];
 
493
  foreach($f->checkout_fields["billing"] as $key => $value) {
494
  if(empty($value['public']) && !is_array($checkout_fields["billing"])) $value['public'] = true;
495
  ?>
@@ -508,7 +533,7 @@ Author URI: http://saphali.com/
508
 
509
  } ?></td>
510
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="billing[<?php echo $key?>][clear]" /></td>
511
- <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
512
  <input value='<?php echo $v_class;?>' type="text" name="billing[<?php echo $key?>][class][]" /> <?php } } else { ?>
513
  <input value='' type="text" name="billing[<?php echo $key?>][class][]" /> <?php
514
  } ?></td>
@@ -574,7 +599,8 @@ Author URI: http://saphali.com/
574
  </tfoot>
575
  <tbody id="the-list" class="myTable">
576
  <?php $count = 0;
577
- if(is_array($checkout_fields["shipping"])) $f->checkout_fields["shipping"] = $checkout_fields["shipping"];
 
578
  foreach($f->checkout_fields["shipping"] as $key => $value) {
579
  if( empty($value['public']) && !is_array($checkout_fields["shipping"]) ) $value['public'] = true;
580
  ?>
@@ -583,7 +609,7 @@ Author URI: http://saphali.com/
583
  <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>
584
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
585
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
586
- <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
587
 
588
  <input value='<?php echo $v_class;?>' type="text" name="shipping[<?php echo $key?>][class][]" /> <?php } } else { ?>
589
  <input value='' type="text" name="shipping[<?php echo $key?>][class][]" /> <?php
@@ -647,7 +673,8 @@ Author URI: http://saphali.com/
647
  </tfoot>
648
  <tbody id="the-list" class="myTable">
649
  <?php $count = 0;
650
- if(is_array($checkout_fields["order"])) $f->checkout_fields["order"] = $checkout_fields["order"];
 
651
  foreach($f->checkout_fields["order"] as $key => $value) {
652
  if(empty($value['public']) && !is_array($checkout_fields["order"])) $value['public'] = true;
653
  ?>
@@ -656,7 +683,7 @@ Author URI: http://saphali.com/
656
  <td><input value='<?php echo $value['label']?>' type="text" name="order[<?php echo $key?>][label]" /></td>
657
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="order[<?php echo $key?>][placeholder]" /></td>
658
 
659
- <td><?php if(is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
660
 
661
  <input value='<?php echo $v_class;?>' type="text" name="order[<?php echo $key?>][class][]" /> <?php } } else { ?>
662
  <input value='' type="text" name="order[<?php echo $key?>][class][]" /> <?php
@@ -1046,6 +1073,21 @@ Author URI: http://saphali.com/
1046
 
1047
  return $fields;
1048
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1049
  function saphali_custom_billing_fields( $fields ) {
1050
 
1051
  $fieldss = get_option('woocommerce_saphali_filds_filters');
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.5.4
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
  */
30
  ------------------------------------------------------------ */
31
  // Подключение валюты и локализации
32
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
33
+ define('SAPHALI_LITE_VERSION', '1.5.4' );
34
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
35
  class saphali_lite {
36
  var $email_order_id;
56
  add_filter( 'woocommerce_order_formatted_billing_address', array($this,'formatted_billing_address') , 10 , 2);
57
  add_filter( 'woocommerce_order_formatted_shipping_address', array($this,'formatted_shipping_address') , 10 , 2);
58
 
59
+ if(@$_GET['page'] != 'woocommerce_saphali_s_l' && @$_GET['tab'] !=1 ) {
60
  // Hook in
61
  add_filter( 'woocommerce_checkout_fields' , array($this,'saphali_custom_override_checkout_fields') );
62
+ add_filter( 'wp' , array($this,'wp') );
63
+
64
  add_filter( 'woocommerce_billing_fields', array($this,'saphali_custom_billing_fields'), 10, 1 );
65
  add_filter( 'woocommerce_shipping_fields', array($this,'saphali_custom_shipping_fields'), 10, 1 );
66
  add_filter( 'woocommerce_default_address_fields', array($this,'woocommerce_default_address_fields'), 10, 1 );
77
  add_filter( 'woocommerce_currency_symbol', array($this,'add_inr_currency_symbol') , 1, 2 );
78
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'checkout_update_order_meta' ), 10, 2 );
79
  }
80
+ public function wp( ) {
81
+ if(function_exists('wc_edit_address_i18n')){
82
+ global $wp;
83
+ if(isset($wp->query_vars['edit-address']))
84
+ add_filter( 'woocommerce_'.wc_edit_address_i18n( sanitize_key( $wp->query_vars['edit-address'] ), true ) .'_fields', array($this,'saphali_custom_edit_address_fields'), 10, 1 );
85
+ }
86
+ }
87
  public function checkout_update_order_meta( $order_id, $posted ) {
88
  if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
89
  $billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
95
  }
96
  }
97
  }
98
+ if ( version_compare( WOOCOMMERCE_VERSION, '2.2.0', '>=' ) && version_compare( WOOCOMMERCE_VERSION, '2.2.2', '<=' ) )
99
+ {
100
+ $billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
101
+ foreach ( array("billing", "shipping") as $type )
102
+ {
103
+ if (isset($billing_data[$type]) && is_array($billing_data[$type]))
104
+ {
105
+ foreach ( $billing_data[$type] as $key => $field ) {
106
+ if (isset($field['public']) && $field['public'] && !empty($posted[$key])) {
107
+ if(!update_post_meta( $order_id, '_' . $key, $posted[$key] )) add_post_meta( $order_id, '_' . $key, $posted[$key] );
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
  }
114
  public function woocommerce_admin_order_totals_after_shipping($id) {
115
  if( apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) == 'RUB' ) {
513
 
514
  $checkout_fields = get_option('woocommerce_saphali_filds');
515
 
516
+ if( isset($checkout_fields["billing"]) && is_array($checkout_fields["billing"])) $f->checkout_fields["billing"] = $checkout_fields["billing"];
517
+ if( isset($f) )
518
  foreach($f->checkout_fields["billing"] as $key => $value) {
519
  if(empty($value['public']) && !is_array($checkout_fields["billing"])) $value['public'] = true;
520
  ?>
533
 
534
  } ?></td>
535
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="billing[<?php echo $key?>][clear]" /></td>
536
+ <td><?php if(isset($value['class']) && is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
537
  <input value='<?php echo $v_class;?>' type="text" name="billing[<?php echo $key?>][class][]" /> <?php } } else { ?>
538
  <input value='' type="text" name="billing[<?php echo $key?>][class][]" /> <?php
539
  } ?></td>
599
  </tfoot>
600
  <tbody id="the-list" class="myTable">
601
  <?php $count = 0;
602
+ if(isset($checkout_fields["shipping"]) && is_array($checkout_fields["shipping"])) $f->checkout_fields["shipping"] = $checkout_fields["shipping"];
603
+ if( isset( $f->checkout_fields["shipping"] ) )
604
  foreach($f->checkout_fields["shipping"] as $key => $value) {
605
  if( empty($value['public']) && !is_array($checkout_fields["shipping"]) ) $value['public'] = true;
606
  ?>
609
  <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>
610
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
611
  <td><input <?php if($value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
612
+ <td><?php if( isset($value['class']) && is_array($value['class']) ) { foreach($value['class'] as $v_class) { ?>
613
 
614
  <input value='<?php echo $v_class;?>' type="text" name="shipping[<?php echo $key?>][class][]" /> <?php } } else { ?>
615
  <input value='' type="text" name="shipping[<?php echo $key?>][class][]" /> <?php
673
  </tfoot>
674
  <tbody id="the-list" class="myTable">
675
  <?php $count = 0;
676
+ if(isset($checkout_fields["order"]) && is_array($checkout_fields["order"])) $f->checkout_fields["order"] = $checkout_fields["order"];
677
+ if(isset($f->checkout_fields["order"]) )
678
  foreach($f->checkout_fields["order"] as $key => $value) {
679
  if(empty($value['public']) && !is_array($checkout_fields["order"])) $value['public'] = true;
680
  ?>
683
  <td><input value='<?php echo $value['label']?>' type="text" name="order[<?php echo $key?>][label]" /></td>
684
  <td><input value='<?php echo $value['placeholder']?>' type="text" name="order[<?php echo $key?>][placeholder]" /></td>
685
 
686
+ <td><?php if(isset($value['class']) && is_array($value['class'])) { foreach($value['class'] as $v_class) { ?>
687
 
688
  <input value='<?php echo $v_class;?>' type="text" name="order[<?php echo $key?>][class][]" /> <?php } } else { ?>
689
  <input value='' type="text" name="order[<?php echo $key?>][class][]" /> <?php
1073
 
1074
  return $fields;
1075
  }
1076
+ function saphali_custom_edit_address_fields( $fields ) {
1077
+ global $wp;
1078
+ $fieldss = get_option('woocommerce_saphali_filds_filters');
1079
+ if(is_array($fieldss))
1080
+ $_fields = $fieldss["billing"];
1081
+ if( isset($_fields) && is_array($_fields) )
1082
+ foreach($_fields as $key => $value) {
1083
+ if(str_replace( 'billing_','', $key ) != 'email')
1084
+ $__fields[wc_edit_address_i18n( sanitize_key( $wp->query_vars['edit-address'] ), true ) . str_replace( 'billing','', $key ) ] = $value;
1085
+ $_a_ = array_diff_assoc ($__fields, $fields);
1086
+ if(is_array($_a_) && is_array($fields) ) $fields = (array)$fields + (array)$_a_;
1087
+ }
1088
+
1089
+ return $fields;
1090
+ }
1091
  function saphali_custom_billing_fields( $fields ) {
1092
 
1093
  $fieldss = get_option('woocommerce_saphali_filds_filters');