Saphali Woocommerce Russian - Version 1.5.7

Version Description

  • .
Download this release

Release Info

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

Code changes from version 1.5.6 to 1.5.7

Files changed (2) hide show
  1. readme.txt +6 -3
  2. saphali-woocommerce-lite.php +54 -37
readme.txt CHANGED
@@ -5,9 +5,9 @@ Plugin URI: http://saphali.com/saphali-woocommerce-plugin-wordpress
5
  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 or higher
8
- Tested up to: 4.2.3
9
- Stable tag: 1.5.6
10
- Version: 1.5.6
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -64,6 +64,9 @@ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интерк
64
 
65
  == Changelog ==
66
 
 
 
 
67
  = 1.5.6 =
68
  * В Woocommerce 2.2 и выше отключена дополнительная локализация для WC, т.к. в этом уже нет надобности.
69
 
5
  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 or higher
8
+ Tested up to: 4.4
9
+ Stable tag: 1.5.7
10
+ Version: 1.5.7
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
64
 
65
  == Changelog ==
66
 
67
+ = 1.5.7 =
68
+ * Добавлен фильтр количества колонок.
69
+
70
  = 1.5.6 =
71
  * В Woocommerce 2.2 и выше отключена дополнительная локализация для WC, т.к. в этом уже нет надобности.
72
 
saphali-woocommerce-lite.php CHANGED
@@ -3,11 +3,11 @@
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.6
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
- Text Domain: themewoocommerce
10
- Domain Path: /languages/
11
 
12
  */
13
 
@@ -33,10 +33,11 @@ Domain Path: /languages/
33
  ------------------------------------------------------------ */
34
  // Подключение валюты и локализации
35
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
36
- define('SAPHALI_LITE_VERSION', '1.5.6' );
37
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
38
  class saphali_lite {
39
  var $email_order_id;
 
40
  function __construct() {
41
  if ( version_compare( WOOCOMMERCE_VERSION, '2.2.0', '<' ) )
42
  add_action('before_woocommerce_init', array($this,'load_plugin_textdomain'), 9);
@@ -82,6 +83,14 @@ Domain Path: /languages/
82
  add_filter( 'woocommerce_currencies', array($this,'add_inr_currency') , 11);
83
  add_filter( 'woocommerce_currency_symbol', array($this,'add_inr_currency_symbol') , 1, 2 );
84
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'checkout_update_order_meta' ), 10, 2 );
 
 
 
 
 
 
 
 
85
  }
86
  public function wp( ) {
87
  if(function_exists('wc_edit_address_i18n')){
@@ -151,10 +160,10 @@ Domain Path: /languages/
151
  }
152
  public function load_plugin_textdomain() {
153
  load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
154
- load_plugin_textdomain( 'themewoocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
155
  }
156
  public function load_plugin_textdomain_th() {
157
- load_plugin_textdomain( 'themewoocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
158
  }
159
  public function woocommerce_default_address_fields($locale) {
160
  $fieldss = get_option('woocommerce_saphali_filds_locate');
@@ -217,15 +226,15 @@ Domain Path: /languages/
217
  add_submenu_page('woocommerce', __('Настройки Saphali WC Lite', 'woocommerce'), __('Saphali WC Lite', 'woocommerce') , 'manage_woocommerce', 'woocommerce_saphali_s_l', array($this,'woocommerce_saphali_page_s_l'));
218
  }
219
  function add_inr_currency( $currencies ) {
220
- $currencies['UAH'] = __( 'Ukrainian hryvnia', 'themewoocommerce' );
221
- $currencies['RUR'] = __( 'Russian ruble', 'themewoocommerce' );
222
- $currencies['RUB'] = __( 'Russian ruble (P)', 'themewoocommerce' );
223
- $currencies['BYR'] = __( 'Belarusian ruble', 'themewoocommerce' );
224
- $currencies['AMD'] = __( 'Armenian dram (Դրամ)', 'themewoocommerce' );
225
- $currencies['KGS'] = __( 'Киргизский сом', 'themewoocommerce' );
226
- $currencies['KZT'] = __( 'Казахстанский тенге ', 'themewoocommerce' );
227
- $currencies['UZS'] = __( 'Узбекский сум', 'themewoocommerce' );
228
- $currencies['LTL'] = __( 'Lithuanian Litas', 'themewoocommerce' );
229
  return $currencies;
230
  }
231
  function add_inr_currency_symbol( $symbol , $currency ) {
@@ -541,7 +550,7 @@ Domain Path: /languages/
541
  <tr>
542
  <td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
543
  <td><input value='<?php echo $value['label']?>' type="text" name="billing[<?php echo $key?>][label]" /></td>
544
- <td<?php if(isset($value['type']) && $value['type'] == 'select') {echo ' class="option-area"';} ?>><?php if(!isset($value['type']) || isset($value['type']) && $value['type'] != 'select') { ?><input value='<?php echo $value['placeholder']?>' type="text" name="billing[<?php echo $key?>][placeholder]" /><?php } else {
545
  if( isset($value['options']) && is_array($value['options']) ) {
546
  foreach($value['options'] as $key_option => $val_option) {?>
547
  <span><input id="options" type="text" name="billing[<?php echo $key?>][options][<?php echo $key_option; ?>]" value="<?php echo $val_option?>" /> <span class="delete-option" style="cursor:pointer;border:1px solid">Удалить</span></span><br />
@@ -627,7 +636,7 @@ Domain Path: /languages/
627
  <tr>
628
  <td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
629
  <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>
630
- <td><input value='<?php echo $value['placeholder']?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
631
  <td><input <?php if(isset($value['clear']) && $value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
632
  <td><?php if( isset($value['class']) && is_array($value['class']) ) { foreach($value['class'] as $v_class) { ?>
633
 
@@ -995,14 +1004,16 @@ Domain Path: /languages/
995
  $_show_fields['shipping'] = $shipping;
996
 
997
 
998
- if(!(@is_array($show_fields['order']['fields']))) {
999
  $_show_fields['order']['title'] = 'Дополнительные поля';
1000
  }
1001
  if(isset($orders))
1002
  $_show_fields['order'] = $orders;
1003
-
1004
  return $_show_fields;
1005
  }
 
 
1006
  function woocommerce_save_customer_meta_fields_saphali( $user_id ) {
1007
  if ( ! current_user_can( 'manage_woocommerce' ) )
1008
  return $columns;
@@ -1262,25 +1273,20 @@ Domain Path: /languages/
1262
  echo '</div>';
1263
  }
1264
  }
1265
- }
1266
-
1267
- add_action('plugins_loaded', 'woocommerce_lang_s_l', 0);
1268
- if ( ! function_exists( 'woocommerce_lang_s_l' ) ) {
1269
- function woocommerce_lang_s_l() {
1270
- $lite = new saphali_lite();
1271
- if( is_admin() )
1272
- add_action( 'admin_enqueue_scripts', array( $lite, 'admin_enqueue_scripts_page_saphali' ) );
 
 
1273
  }
1274
- }
1275
- //END
1276
- $column_count_saphali = get_option('column_count_saphali');
1277
- if(!empty($column_count_saphali)) {
1278
- global $woocommerce_loop;
1279
- $woocommerce_loop['columns'] = $column_count_saphali;
1280
- add_action("wp_head", 'print_script_columns', 10, 1);
1281
  function print_script_columns($woocommerce_loop) {
1282
  global $woocommerce_loop;
1283
- if($woocommerce_loop['columns'] > 0) {
1284
  ?>
1285
  <style type='text/css'>
1286
  .woocommerce ul.products li.product {
@@ -1290,15 +1296,26 @@ if(!empty($column_count_saphali)) {
1290
  <?php
1291
  }
1292
  }
 
 
 
 
 
 
 
 
 
1293
  }
 
 
1294
  add_action("wp_head", '_print_script_columns', 10, 1);
1295
  function _print_script_columns() {
1296
  if(apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) != 'RUB') return;
1297
  ?>
1298
  <style type="text/css">
1299
  @font-face { font-family: "Rubl Sign"; src: url(<?php echo SAPHALI_PLUGIN_DIR_URL; ?>ruble.eot); }
1300
- span.rur { font-family: "Rubl Sign"; text-transform: uppercase; // text-transform: none;}
1301
- span.rur span { position: absolute; overflow: hidden; width: .45em; height: 1em; margin: .2ex 0 0 -.55em; // display: none; }
1302
  span.rur span:before { content: '\2013'; }
1303
  </style>
1304
  <?php
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.7
7
  Author: Saphali
8
  Author URI: http://saphali.com/
9
+ Text Domain: saphali-woocommerce-lite
10
+ Domain Path: /languages
11
 
12
  */
13
 
33
  ------------------------------------------------------------ */
34
  // Подключение валюты и локализации
35
  define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
36
+ define('SAPHALI_LITE_VERSION', '1.5.7' );
37
  define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
38
  class saphali_lite {
39
  var $email_order_id;
40
+ var $column_count_saphali;
41
  function __construct() {
42
  if ( version_compare( WOOCOMMERCE_VERSION, '2.2.0', '<' ) )
43
  add_action('before_woocommerce_init', array($this,'load_plugin_textdomain'), 9);
83
  add_filter( 'woocommerce_currencies', array($this,'add_inr_currency') , 11);
84
  add_filter( 'woocommerce_currency_symbol', array($this,'add_inr_currency_symbol') , 1, 2 );
85
  add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'checkout_update_order_meta' ), 10, 2 );
86
+ $this->column_count_saphali = get_option('column_count_saphali');
87
+ if(!empty($this->column_count_saphali)) {
88
+ global $woocommerce_loop;
89
+ $woocommerce_loop['columns'] = $this->column_count_saphali;
90
+ add_action("wp_head", array($this,'print_script_columns'), 10, 1);
91
+ add_filter("loop_shop_columns", array($this, 'print_columns'), 10, 1);
92
+ add_filter("woocommerce_output_related_products_args", array($this, 'related_print_columns'), 10, 1);
93
+ }
94
  }
95
  public function wp( ) {
96
  if(function_exists('wc_edit_address_i18n')){
160
  }
161
  public function load_plugin_textdomain() {
162
  load_plugin_textdomain( 'woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
163
+ load_plugin_textdomain( 'saphali-woocommerce-lite', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
164
  }
165
  public function load_plugin_textdomain_th() {
166
+ load_plugin_textdomain( 'saphali-woocommerce-lite', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
167
  }
168
  public function woocommerce_default_address_fields($locale) {
169
  $fieldss = get_option('woocommerce_saphali_filds_locate');
226
  add_submenu_page('woocommerce', __('Настройки Saphali WC Lite', 'woocommerce'), __('Saphali WC Lite', 'woocommerce') , 'manage_woocommerce', 'woocommerce_saphali_s_l', array($this,'woocommerce_saphali_page_s_l'));
227
  }
228
  function add_inr_currency( $currencies ) {
229
+ $currencies['UAH'] = __( 'Ukrainian hryvnia', 'saphali-woocommerce-lite' );
230
+ $currencies['RUR'] = __( 'Russian ruble', 'saphali-woocommerce-lite' );
231
+ $currencies['RUB'] = __( 'Russian ruble (P)', 'saphali-woocommerce-lite' );
232
+ $currencies['BYR'] = __( 'Belarusian ruble', 'saphali-woocommerce-lite' );
233
+ $currencies['AMD'] = __( 'Armenian dram (Դրամ)', 'saphali-woocommerce-lite' );
234
+ $currencies['KGS'] = __( 'Киргизский сом', 'saphali-woocommerce-lite' );
235
+ $currencies['KZT'] = __( 'Казахстанский тенге ', 'saphali-woocommerce-lite' );
236
+ $currencies['UZS'] = __( 'Узбекский сум', 'saphali-woocommerce-lite' );
237
+ $currencies['LTL'] = __( 'Lithuanian Litas', 'saphali-woocommerce-lite' );
238
  return $currencies;
239
  }
240
  function add_inr_currency_symbol( $symbol , $currency ) {
550
  <tr>
551
  <td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
552
  <td><input value='<?php echo $value['label']?>' type="text" name="billing[<?php echo $key?>][label]" /></td>
553
+ <td<?php if(isset($value['type']) && $value['type'] == 'select') {echo ' class="option-area"';} ?>><?php if(!isset($value['type']) || isset($value['type']) && $value['type'] != 'select') { ?><input value='<?php if(isset( $value['placeholder'] )) echo $value['placeholder']; ?>' type="text" name="billing[<?php echo $key?>][placeholder]" /><?php } else {
554
  if( isset($value['options']) && is_array($value['options']) ) {
555
  foreach($value['options'] as $key_option => $val_option) {?>
556
  <span><input id="options" type="text" name="billing[<?php echo $key?>][options][<?php echo $key_option; ?>]" value="<?php echo $val_option?>" /> <span class="delete-option" style="cursor:pointer;border:1px solid">Удалить</span></span><br />
636
  <tr>
637
  <td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
638
  <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>
639
+ <td><input value='<?php if(isset( $value['placeholder'] )) echo $value['placeholder']; ?>' type="text" name="shipping[<?php echo $key?>][placeholder]" /></td>
640
  <td><input <?php if(isset($value['clear']) && $value['clear']) echo 'checked'?> class="<?php echo $value['clear']?>" type="checkbox" name="shipping[<?php echo $key?>][clear]" /></td>
641
  <td><?php if( isset($value['class']) && is_array($value['class']) ) { foreach($value['class'] as $v_class) { ?>
642
 
1004
  $_show_fields['shipping'] = $shipping;
1005
 
1006
 
1007
+ if(isset($show_fields['order']) && !(@is_array($show_fields['order']['fields']))) {
1008
  $_show_fields['order']['title'] = 'Дополнительные поля';
1009
  }
1010
  if(isset($orders))
1011
  $_show_fields['order'] = $orders;
1012
+ if (isset($_show_fields)) {
1013
  return $_show_fields;
1014
  }
1015
+
1016
+ }
1017
  function woocommerce_save_customer_meta_fields_saphali( $user_id ) {
1018
  if ( ! current_user_can( 'manage_woocommerce' ) )
1019
  return $columns;
1273
  echo '</div>';
1274
  }
1275
  }
1276
+ function print_columns ($columns) {
1277
+ return $this->column_count_saphali;
1278
+ }
1279
+ function related_print_columns ($columns) {
1280
+ if( isset($columns['columns']) ) {
1281
+ $columns['columns'] = $this->column_count_saphali;
1282
+ $columns['posts_per_page'] = $this->column_count_saphali;
1283
+ }
1284
+
1285
+ return $columns;
1286
  }
 
 
 
 
 
 
 
1287
  function print_script_columns($woocommerce_loop) {
1288
  global $woocommerce_loop;
1289
+ if($woocommerce_loop['columns'] > 0 && $woocommerce_loop['columns'] != 4) {
1290
  ?>
1291
  <style type='text/css'>
1292
  .woocommerce ul.products li.product {
1296
  <?php
1297
  }
1298
  }
1299
+ }
1300
+
1301
+ add_action('plugins_loaded', 'woocommerce_lang_s_l', 0);
1302
+ if ( ! function_exists( 'woocommerce_lang_s_l' ) ) {
1303
+ function woocommerce_lang_s_l() {
1304
+ $lite = new saphali_lite();
1305
+ if( is_admin() )
1306
+ add_action( 'admin_enqueue_scripts', array( $lite, 'admin_enqueue_scripts_page_saphali' ) );
1307
+ }
1308
  }
1309
+ //END
1310
+
1311
  add_action("wp_head", '_print_script_columns', 10, 1);
1312
  function _print_script_columns() {
1313
  if(apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) != 'RUB') return;
1314
  ?>
1315
  <style type="text/css">
1316
  @font-face { font-family: "Rubl Sign"; src: url(<?php echo SAPHALI_PLUGIN_DIR_URL; ?>ruble.eot); }
1317
+ span.rur { font-family: "Rubl Sign"; text-transform: uppercase;}
1318
+ span.rur span { position: absolute; overflow: hidden; width: .45em; height: 1em; margin: .2ex 0 0 -.55em; }
1319
  span.rur span:before { content: '\2013'; }
1320
  </style>
1321
  <?php