Version Description
- .
Download this release
Release Info
Developer | Saphali |
Plugin | Saphali Woocommerce Russian |
Version | 1.8.10 |
Comparing to | |
See all releases |
Code changes from version 1.8.9 to 1.8.10
- readme.txt +4 -1
- saphali-woocommerce-lite.php +22 -15
readme.txt
CHANGED
@@ -6,7 +6,7 @@ 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.
|
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.9 =
|
80 |
* Смена условия вывода методов доставки в настройках.
|
81 |
|
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.10
|
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.10 =
|
80 |
+
* Исправление ошибок.
|
81 |
+
|
82 |
= 1.8.9 =
|
83 |
* Смена условия вывода методов доставки в настройках.
|
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.
|
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.
|
13 |
*/
|
14 |
|
15 |
|
@@ -35,7 +35,7 @@ WC tested up to: 4.5
|
|
35 |
|
36 |
// Подключение валюты и локализации
|
37 |
define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
|
38 |
-
define('SAPHALI_LITE_VERSION', '1.8.
|
39 |
define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
|
40 |
class saphali_lite {
|
41 |
var $email_order_id;
|
@@ -372,7 +372,8 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
372 |
var $skeys = <?php if( isset($skeys) ) echo json_encode($skeys); else echo '[]'; ?>;
|
373 |
function corect_payment_method_filds () {
|
374 |
var selected_p_method = jQuery("input[name=\"payment_method\"]:checked").val();
|
375 |
-
jQuery.each($keys, function(i,e){
|
|
|
376 |
if( jQuery.inArray( selected_p_method, e ) >= 0 ) {
|
377 |
if( ! ( jQuery("#billing_platelshik_is_grpl").is(':checked') && ( i == 'billing_gruzopoluch' || i == 'billing_gruzopoluch_okpo') ) )
|
378 |
jQuery("#" + i + "_field").show('slow');
|
@@ -383,7 +384,8 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
383 |
}
|
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 {
|
@@ -419,7 +421,8 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
419 |
foreach ( $billing_data[$type] as $key => $field ) {
|
420 |
|
421 |
if (isset($field['public']) && $field['public'] ) {
|
422 |
-
$
|
|
|
423 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[str_replace($type . '_', '', $key)]) && ( strpos($key, 'new_fild') !== false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
424 |
$this->unuque[] = $key;
|
425 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[str_replace($type . '_', '', $key)].'<br />';
|
@@ -432,10 +435,11 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
432 |
}
|
433 |
function formatted_shipping_address($address, $order) {
|
434 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
435 |
-
if(is_array($billing_data["order"])) {
|
436 |
foreach ( $billing_data["order"] as $key => $field ) {
|
437 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
438 |
-
$
|
|
|
439 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[ str_replace('order_', '', $key) ]) && ( strpos($key, 'new_fild') === false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
440 |
$this->unuque[] = $key;
|
441 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[ str_replace('order_', '', $key) ] . '<br />';
|
@@ -449,7 +453,8 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
449 |
foreach ( $billing_data[$type] as $key => $field ) {
|
450 |
|
451 |
if (isset($field['public']) && $field['public'] ) {
|
452 |
-
$
|
|
|
453 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[str_replace($type . '_', '', $key)]) && ( strpos($key, 'new_fild') === false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
454 |
$this->unuque[] = $key;
|
455 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[str_replace($type . '_', '', $key)].'<br />';
|
@@ -464,7 +469,7 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
464 |
function woocommerce_admin_billing_fields($billing_fields) {
|
465 |
if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
|
466 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
467 |
-
if(is_array($billing_data["billing"])) {
|
468 |
foreach ( $billing_data["billing"] as $key => $field ) {
|
469 |
$key = str_replace('billing_', '', $key);
|
470 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
@@ -486,7 +491,7 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
486 |
function woocommerce_admin_shipping_fields($shipping_fields) {
|
487 |
if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
|
488 |
$shipping_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
489 |
-
if(is_array($shipping_data["shipping"])) {
|
490 |
foreach ( $shipping_data["shipping"] as $key => $field ) {
|
491 |
$key = str_replace('shipping_', '', $key);
|
492 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
@@ -953,7 +958,9 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
953 |
if( isset( $checkout_fields["billing"][$key] ) ) $value['shipping_method'] = $checkout_fields["billing"][$key]['shipping_method'];
|
954 |
}
|
955 |
|
956 |
-
if(empty($value[$public]) &&
|
|
|
|
|
957 |
?>
|
958 |
<tr>
|
959 |
<td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
|
@@ -1102,7 +1109,7 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
1102 |
}
|
1103 |
if( isset( $checkout_fields["shipping"][$key] ) ) $value['shipping_method'] = $checkout_fields["shipping"][$key]['shipping_method'];
|
1104 |
}
|
1105 |
-
if( empty($value['public']) && !is_array($checkout_fields["shipping"]) ) $value['public'] = true;
|
1106 |
?>
|
1107 |
<tr>
|
1108 |
<td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
|
@@ -1198,7 +1205,7 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
1198 |
if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
|
1199 |
if( isset( $checkout_fields["order"][$key] ) ) $value[$public] = $checkout_fields["order"][$key][$public];
|
1200 |
}
|
1201 |
-
if(empty($value['public']) && !is_array($checkout_fields["order"])) $value['public'] = true;
|
1202 |
?>
|
1203 |
<tr>
|
1204 |
<td><input disabled value=<?php echo $key?> type="text" name="order[<?php echo $key?>][name]" /></td>
|
@@ -1639,7 +1646,7 @@ public function woocommerce_checkout_posted_data( $data ) {
|
|
1639 |
function woocommerce_admin_order_data_after_order_details_s($order) {
|
1640 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
1641 |
echo '<div class="address">';
|
1642 |
-
if(is_array($billing_data["order"])) {
|
1643 |
foreach ( $billing_data["order"] as $key => $field ) : if (isset($field['show']) && !$field['show']) continue;
|
1644 |
|
1645 |
$field_name = '_'.$key;
|
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.10
|
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.6
|
13 |
*/
|
14 |
|
15 |
|
35 |
|
36 |
// Подключение валюты и локализации
|
37 |
define('SAPHALI_PLUGIN_DIR_URL',plugin_dir_url(__FILE__));
|
38 |
+
define('SAPHALI_LITE_VERSION', '1.8.10' );
|
39 |
define('SAPHALI_PLUGIN_DIR_PATH',plugin_dir_path(__FILE__));
|
40 |
class saphali_lite {
|
41 |
var $email_order_id;
|
372 |
var $skeys = <?php if( isset($skeys) ) echo json_encode($skeys); else echo '[]'; ?>;
|
373 |
function corect_payment_method_filds () {
|
374 |
var selected_p_method = jQuery("input[name=\"payment_method\"]:checked").val();
|
375 |
+
jQuery.each($keys, function(i,e){
|
376 |
+
e = Object.keys(e).map(function(v){ return e[v]});
|
377 |
if( jQuery.inArray( selected_p_method, e ) >= 0 ) {
|
378 |
if( ! ( jQuery("#billing_platelshik_is_grpl").is(':checked') && ( i == 'billing_gruzopoluch' || i == 'billing_gruzopoluch_okpo') ) )
|
379 |
jQuery("#" + i + "_field").show('slow');
|
384 |
}
|
385 |
function corect_shipping_method_filds () {
|
386 |
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] : '';
|
387 |
+
jQuery.each($skeys, function(i,e){
|
388 |
+
e = Object.keys(e).map(function(v){ return e[v]});
|
389 |
if( jQuery.inArray( selected_s_method, e ) >= 0 || e.filter(function(v){ return selected_s_method.indexOf(v) === 0; }).length > 0 ) {
|
390 |
jQuery("#" + i + "_field").show('slow');
|
391 |
} else {
|
421 |
foreach ( $billing_data[$type] as $key => $field ) {
|
422 |
|
423 |
if (isset($field['public']) && $field['public'] ) {
|
424 |
+
$id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
|
425 |
+
$address[str_replace($type . '_', '', $key)] = get_post_meta( $id, '_' . $key, true );
|
426 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[str_replace($type . '_', '', $key)]) && ( strpos($key, 'new_fild') !== false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
427 |
$this->unuque[] = $key;
|
428 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[str_replace($type . '_', '', $key)].'<br />';
|
435 |
}
|
436 |
function formatted_shipping_address($address, $order) {
|
437 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
438 |
+
if(isset($billing_data["order"]) && is_array($billing_data["order"])) {
|
439 |
foreach ( $billing_data["order"] as $key => $field ) {
|
440 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
441 |
+
$id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
|
442 |
+
$address[ str_replace('order_', '', $key) ] = get_post_meta( $id, '_' . $key, true );
|
443 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[ str_replace('order_', '', $key) ]) && ( strpos($key, 'new_fild') === false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
444 |
$this->unuque[] = $key;
|
445 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[ str_replace('order_', '', $key) ] . '<br />';
|
453 |
foreach ( $billing_data[$type] as $key => $field ) {
|
454 |
|
455 |
if (isset($field['public']) && $field['public'] ) {
|
456 |
+
$id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
|
457 |
+
$address[str_replace($type . '_', '', $key)] = get_post_meta( $id, '_' . $key, true );
|
458 |
if( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) && !empty($address[str_replace($type . '_', '', $key)]) && ( strpos($key, 'new_fild') === false) && (isset($this->unuque) && !in_array($key, $this->unuque) ) ) {
|
459 |
$this->unuque[] = $key;
|
460 |
echo '<label><strong>'. $field['label']. ':</strong></label> ' . $address[str_replace($type . '_', '', $key)].'<br />';
|
469 |
function woocommerce_admin_billing_fields($billing_fields) {
|
470 |
if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
|
471 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
472 |
+
if(isset($billing_data["billing"]) && is_array($billing_data["billing"])) {
|
473 |
foreach ( $billing_data["billing"] as $key => $field ) {
|
474 |
$key = str_replace('billing_', '', $key);
|
475 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
491 |
function woocommerce_admin_shipping_fields($shipping_fields) {
|
492 |
if ( !version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) ) {
|
493 |
$shipping_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
494 |
+
if(isset($shipping_data["shipping"]) && is_array($shipping_data["shipping"])) {
|
495 |
foreach ( $shipping_data["shipping"] as $key => $field ) {
|
496 |
$key = str_replace('shipping_', '', $key);
|
497 |
if (isset($field['show']) && !$field['show'] || $key == 'order_comments') continue;
|
958 |
if( isset( $checkout_fields["billing"][$key] ) ) $value['shipping_method'] = $checkout_fields["billing"][$key]['shipping_method'];
|
959 |
}
|
960 |
|
961 |
+
if(empty($value[$public]) &&
|
962 |
+
(isset($checkout_fields["billing"]) && !is_array($checkout_fields["billing"]) || !isset($checkout_fields["billing"])))
|
963 |
+
$value[$public] = true;
|
964 |
?>
|
965 |
<tr>
|
966 |
<td> <input disabled value='<?php echo $key?>' type="text" name="billing[<?php echo $key?>][name]" /></td>
|
1109 |
}
|
1110 |
if( isset( $checkout_fields["shipping"][$key] ) ) $value['shipping_method'] = $checkout_fields["shipping"][$key]['shipping_method'];
|
1111 |
}
|
1112 |
+
if( empty($value['public']) && (isset($checkout_fields["shipping"]) && !is_array($checkout_fields["shipping"]) || !isset($checkout_fields["shipping"])) ) $value['public'] = true;
|
1113 |
?>
|
1114 |
<tr>
|
1115 |
<td><input disabled value=<?php echo $key?> type="text" name="shipping[<?php echo $key?>][name]" /></td>
|
1205 |
if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
|
1206 |
if( isset( $checkout_fields["order"][$key] ) ) $value[$public] = $checkout_fields["order"][$key][$public];
|
1207 |
}
|
1208 |
+
if(empty($value['public']) && (isset($checkout_fields["order"]) && !is_array($checkout_fields["order"]) || !isset($checkout_fields["order"]))) $value['public'] = true;
|
1209 |
?>
|
1210 |
<tr>
|
1211 |
<td><input disabled value=<?php echo $key?> type="text" name="order[<?php echo $key?>][name]" /></td>
|
1646 |
function woocommerce_admin_order_data_after_order_details_s($order) {
|
1647 |
$billing_data = $this->woocommerce_get_customer_meta_fields_saphali();
|
1648 |
echo '<div class="address">';
|
1649 |
+
if(isset($billing_data["order"]) && is_array($billing_data["order"])) {
|
1650 |
foreach ( $billing_data["order"] as $key => $field ) : if (isset($field['show']) && !$field['show']) continue;
|
1651 |
|
1652 |
$field_name = '_'.$key;
|