Saphali Woocommerce Russian - Version 1.8.2

Version Description

  • Fix WC > 3.0.
  • .
Download this release

Release Info

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

Code changes from version 1.8.1.1 to 1.8.2

Files changed (2) hide show
  1. readme.txt +9 -2
  2. saphali-woocommerce-lite.php +53 -13
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: 4.9
9
- Stable tag: 1.8.1.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -57,12 +57,15 @@ QIWI, Приват24, LiqPay, WebMoney, Яндекс.Деньги, Интерк
57
  == Frequently Asked Questions ==
58
 
59
  = Знак рубля =
60
- В WC 2.5.2 и выше есть встроенный знак рубля, который представлен в виде одного знака в юникоде. Из-за частых обращений, что знак рубля не отображается нормально в WC 2.5.2 и выше, когда мы убрали формирование знака данным плагином, потому знак рубля вернули обратно. Для тех у кого WC 2.5.2 и выше, и кто хочет использовать на своем сайте знак, который задан в WC, то пусть в файле saphali-woocommerce-lite.php сделает замену:
61
  с
62
  define('SAPHALI_LITE_SYMBOL', 1 );
63
  на
64
  define('SAPHALI_LITE_SYMBOL', 0 );
65
 
 
 
 
66
  == Screenshots ==
67
 
68
  1. Улучшенная русская локализация Woocommerce. В общий список валют добавлены — Украинская гривна (грн.), Российский рубль (руб.), Белорусский рубль (руб.), Armenian dram (Դրամ), Киргизский сом (сом) и Казахстанский тенге (тңг), Узбекский сум, Литовский лит
@@ -73,6 +76,10 @@ define('SAPHALI_LITE_SYMBOL', 0 );
73
 
74
  == Changelog ==
75
 
 
 
 
 
76
  = 1.8.1.1 =
77
  * Небольшие правки (Notice).
78
 
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.9
9
+ Stable tag: 1.8.2
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
57
  == Frequently Asked Questions ==
58
 
59
  = Знак рубля =
60
+ В WC 2.5.2 и выше есть встроенный знак рубля, который представлен в виде одного знака (в юникоде). Из-за частых обращений, что знак рубля не отображается нормально в WC 2.5.2 и выше, когда мы убрали формирование знака данным плагином, потому знак рубля вернули обратно. Для тех у кого WC 2.5.2 и выше, и кто хочет использовать на своем сайте знак, который задан в WC, то пусть в файле saphali-woocommerce-lite.php сделает замену:
61
  с
62
  define('SAPHALI_LITE_SYMBOL', 1 );
63
  на
64
  define('SAPHALI_LITE_SYMBOL', 0 );
65
 
66
+ = Ошибка "Please enter an address to continue" =
67
+ При ошибке (в WC > 3.4) "<em>Пожалуйста, введите адрес для продолжения</em>", нужно посмотреть не удалено или не выключено поле <strong>billing_country</strong>. Если есть доставка, то без местонахождения, WC не дает совершить заказ. Зоны доставки работают при определении в первую очередь страны (в зависимости от настроек, геолокализация или адрес магазина), если этого сделать невозможно, т.к. нет соответствующего поля, то происходит вывод данного уведомления.
68
+
69
  == Screenshots ==
70
 
71
  1. Улучшенная русская локализация Woocommerce. В общий список валют добавлены — Украинская гривна (грн.), Российский рубль (руб.), Белорусский рубль (руб.), Armenian dram (Դրամ), Киргизский сом (сом) и Казахстанский тенге (тңг), Узбекский сум, Литовский лит
76
 
77
  == Changelog ==
78
 
79
+ = 1.8.2 =
80
+ * Fix позиции полей на странице заказа в WC > 3.0.
81
+ * Небольшие правки.
82
+
83
  = 1.8.1.1 =
84
  * Небольшие правки (Notice).
85
 
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.1.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.6
13
  */
14
 
15
 
@@ -513,6 +513,10 @@ WC tested up to: 3.2.6
513
  if(isset($_v['label'])) {
514
  $_fieldss[$_k]['label'] = __( $_v['label'], 'woocommerce');
515
  }
 
 
 
 
516
  if(isset($_v['placeholder'])) {
517
  $_fieldss[$_k]['placeholder'] = __( $_v['placeholder'], 'woocommerce');
518
  }
@@ -776,7 +780,7 @@ WC tested up to: 3.2.6
776
 
777
  if( !isset($global_f_checkout_fields["shipping"][$key_post]['type']) ) unset($filds["shipping"][$key_post]['type'], $value_post["type"]);
778
 
779
- if($filds["shipping"][$key_post]['public'] != 'on') {
780
  $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = false;
781
  $fild_remove_filter["shipping"][] = $key_post;
782
  } else {$filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = true;}
@@ -1062,7 +1066,8 @@ WC tested up to: 3.2.6
1062
  foreach($global_f_checkout_fields["shipping"] as $key => $value) {
1063
  $public = 'public';
1064
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
1065
- if( isset( $checkout_fields["shipping"][$key] ) ) $value[$public] = $checkout_fields["shipping"][$key][$public];
 
1066
  }
1067
  if(isset($checkout_fields["shipping"][$key]['payment_method'])) {
1068
  $pm_k_remove = array();
@@ -1572,8 +1577,9 @@ WC tested up to: 3.2.6
1572
  $field_name = '_'.$key;
1573
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1574
  $value_fild = @$order->order_custom_fields[$field_name][0];
1575
- else
1576
  $value_fild = $order->__get( $key );
 
1577
  if ( $value_fild && !empty($field['label']) ) echo '<p><strong>'.$field['label'].':</strong> '.$value_fild.'</p>';
1578
 
1579
  endforeach;
@@ -1590,8 +1596,9 @@ WC tested up to: 3.2.6
1590
 
1591
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1592
  $value_fild = @$order->order_custom_fields[$field_name][0];
1593
- else
1594
  $value_fild = $order->__get( $key );
 
1595
  if ( $value_fild && !empty($field['label']) ) echo '<p><strong>'.$field['label'].':</strong> '.$value_fild.'</p>';
1596
 
1597
  endforeach;
@@ -1607,8 +1614,9 @@ WC tested up to: 3.2.6
1607
  $field_name = '_'.$key;
1608
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1609
  $value_fild = @$order->order_custom_fields[$field_name][0];
1610
- else
1611
  $value_fild = $order->__get( $key );
 
1612
  if ( $value_fild && !empty($field['label']) )
1613
 
1614
  echo '<div class="form-field form-field-wide"><label>'. $field['label']. ':</label> ' . $value_fild.'</div>';
@@ -1624,6 +1632,11 @@ WC tested up to: 3.2.6
1624
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1625
  $fieldss = $this->fieldss;
1626
 
 
 
 
 
 
1627
  if(is_array($fieldss)) {
1628
  $fields["billing"] = $fieldss["billing"];
1629
  $fields["shipping"] = $fieldss["shipping"];
@@ -1631,6 +1644,8 @@ WC tested up to: 3.2.6
1631
  }
1632
  foreach(array("billing", "shipping", "order") as $v)
1633
  foreach($fields[$v] as $key => $value) {
 
 
1634
  if(isset($fields[$v][$key]["label"]))
1635
  $fields[$v][$key]["label"] = __($value["label"], 'woocommerce');
1636
  if(isset($fields[$v][$key]["placeholder"]))
@@ -1643,6 +1658,11 @@ WC tested up to: 3.2.6
1643
  if(! isset($this->fieldss) )
1644
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1645
  $fieldss = $this->fieldss;
 
 
 
 
 
1646
  $__fields = array();
1647
  if(is_array($fieldss))
1648
  $_fields = $fieldss["billing"];
@@ -1655,6 +1675,8 @@ WC tested up to: 3.2.6
1655
  if(is_array($_a_) && is_array($fields) ) $fields = (array)$fields + (array)$_a_;
1656
 
1657
  foreach($fields as $key => $value) {
 
 
1658
  if(isset($fields[$key]["label"]))
1659
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1660
  if(isset($fields[$key]["placeholder"]))
@@ -1663,19 +1685,28 @@ WC tested up to: 3.2.6
1663
  return $fields;
1664
  }
1665
  function saphali_custom_billing_fields( $fields ) {
 
1666
  if(! isset($this->fieldss) )
1667
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1668
  $fieldss = $this->fieldss;
 
 
 
 
 
1669
 
1670
  if(is_array($fieldss))
1671
  $fields = $fieldss["billing"];
1672
  foreach($fields as $key => $value) {
 
 
1673
  if(isset($fields[$key]["label"]))
1674
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1675
  if(isset($fields[$key]["placeholder"]))
1676
  $fields[$key]["placeholder"] = __($value["placeholder"], 'woocommerce');
1677
 
1678
  }
 
1679
  return $fields;
1680
  }
1681
  function saphali_custom_shipping_fields( $fields ) {
@@ -1685,6 +1716,8 @@ WC tested up to: 3.2.6
1685
  if(is_array($fieldss))
1686
  $fields = $fieldss["shipping"];
1687
  foreach($fields as $key => $value) {
 
 
1688
  if(isset($fields[$key]["label"]))
1689
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1690
  if(isset($fields[$key]["placeholder"]))
@@ -1710,8 +1743,9 @@ WC tested up to: 3.2.6
1710
  $field_name = '_'.$key;
1711
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1712
  $value_fild = @$order->order_custom_fields[$field_name][0];
1713
- else
1714
  $value_fild = $order->__get( $key );
 
1715
  if ( $value_fild && !empty($field['label']) )
1716
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1717
  endforeach;
@@ -1721,8 +1755,9 @@ WC tested up to: 3.2.6
1721
  $field_name = '_'.$key;
1722
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1723
  $value_fild = @$order->order_custom_fields[$field_name][0];
1724
- else
1725
  $value_fild = $order->__get( $key );
 
1726
  if ( $value_fild && !empty($field['label']))
1727
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1728
  endforeach;
@@ -1733,8 +1768,10 @@ WC tested up to: 3.2.6
1733
  $field_name = '_'.$key;
1734
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1735
  $value_fild = @$order->order_custom_fields[$field_name][0];
1736
- else
1737
  $value_fild = $order->__get( $key );
 
 
1738
  if ( $value_fild && !empty($field['label']) )
1739
 
1740
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
@@ -1801,8 +1838,9 @@ WC tested up to: 3.2.6
1801
  $field_name = '_'.$key;
1802
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1803
  $value_fild = @$order->order_custom_fields[$field_name][0];
1804
- else
1805
  $value_fild = $order->__get( $key );
 
1806
  if ( $value_fild && !empty($field['label']))
1807
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1808
  endforeach;
@@ -1812,8 +1850,9 @@ WC tested up to: 3.2.6
1812
  $field_name = '_'.$key;
1813
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1814
  $value_fild = @$order->order_custom_fields[$field_name][0];
1815
- else
1816
  $value_fild = $order->__get( $key );
 
1817
  if ( $value_fild && !empty($field['label']) )
1818
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1819
  endforeach;
@@ -1823,8 +1862,9 @@ WC tested up to: 3.2.6
1823
  $field_name = '_'.$key;
1824
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1825
  $value_fild = @$order->order_custom_fields[$field_name][0];
1826
- else
1827
  $value_fild = $order->__get( $key );
 
1828
  if ( $value_fild && !empty($field['label']) )
1829
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1830
  endforeach;
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.2
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.4
13
  */
14
 
15
 
513
  if(isset($_v['label'])) {
514
  $_fieldss[$_k]['label'] = __( $_v['label'], 'woocommerce');
515
  }
516
+ if(isset($_v['order'])) {
517
+ $_fieldss[$_k]["priority"] = $_v['order']+10;
518
+ $_fieldss[$_k]["order"] = $_v['order']+10;
519
+ }
520
  if(isset($_v['placeholder'])) {
521
  $_fieldss[$_k]['placeholder'] = __( $_v['placeholder'], 'woocommerce');
522
  }
780
 
781
  if( !isset($global_f_checkout_fields["shipping"][$key_post]['type']) ) unset($filds["shipping"][$key_post]['type'], $value_post["type"]);
782
 
783
+ if( isset($filds["shipping"][$key_post]['public']) && $filds["shipping"][$key_post]['public'] != 'on') {
784
  $filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = false;
785
  $fild_remove_filter["shipping"][] = $key_post;
786
  } else {$filds_new["shipping"][$filds["shipping"][$key_post]["order"]][$key_post]["public"] = true;}
1066
  foreach($global_f_checkout_fields["shipping"] as $key => $value) {
1067
  $public = 'public';
1068
  if( ! version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) ) {
1069
+ if( isset( $checkout_fields["shipping"][$key] ) && isset( $checkout_fields["shipping"][$key][$public] ) )
1070
+ $value[$public] = $checkout_fields["shipping"][$key][$public];
1071
  }
1072
  if(isset($checkout_fields["shipping"][$key]['payment_method'])) {
1073
  $pm_k_remove = array();
1577
  $field_name = '_'.$key;
1578
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1579
  $value_fild = @$order->order_custom_fields[$field_name][0];
1580
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1581
  $value_fild = $order->__get( $key );
1582
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1583
  if ( $value_fild && !empty($field['label']) ) echo '<p><strong>'.$field['label'].':</strong> '.$value_fild.'</p>';
1584
 
1585
  endforeach;
1596
 
1597
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1598
  $value_fild = @$order->order_custom_fields[$field_name][0];
1599
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1600
  $value_fild = $order->__get( $key );
1601
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1602
  if ( $value_fild && !empty($field['label']) ) echo '<p><strong>'.$field['label'].':</strong> '.$value_fild.'</p>';
1603
 
1604
  endforeach;
1614
  $field_name = '_'.$key;
1615
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1616
  $value_fild = @$order->order_custom_fields[$field_name][0];
1617
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1618
  $value_fild = $order->__get( $key );
1619
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1620
  if ( $value_fild && !empty($field['label']) )
1621
 
1622
  echo '<div class="form-field form-field-wide"><label>'. $field['label']. ':</label> ' . $value_fild.'</div>';
1632
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1633
  $fieldss = $this->fieldss;
1634
 
1635
+ if(isset($fieldss["billing"]["billing_city"]) && $fields["billing"]["billing_city"]["type"] == 'select') {
1636
+ if(isset($fieldss["billing"]["billing_city"]["order"]))
1637
+ $fields["billing"]["billing_city"]["order"] = $fieldss["billing"]["billing_city"]["order"];
1638
+ $fieldss["billing"]["billing_city"] = $fields["billing"]["billing_city"];
1639
+ }
1640
  if(is_array($fieldss)) {
1641
  $fields["billing"] = $fieldss["billing"];
1642
  $fields["shipping"] = $fieldss["shipping"];
1644
  }
1645
  foreach(array("billing", "shipping", "order") as $v)
1646
  foreach($fields[$v] as $key => $value) {
1647
+ if(isset($fields[$v][$key]["order"]))
1648
+ $fields[$v][$key]["priority"] = $value["order"]+10;
1649
  if(isset($fields[$v][$key]["label"]))
1650
  $fields[$v][$key]["label"] = __($value["label"], 'woocommerce');
1651
  if(isset($fields[$v][$key]["placeholder"]))
1658
  if(! isset($this->fieldss) )
1659
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1660
  $fieldss = $this->fieldss;
1661
+ if(isset($fieldss["billing"]["billing_city"]) && $fields["billing"]["billing_city"]["type"] == 'select') {
1662
+ if(isset($fieldss["billing"]["billing_city"]["order"]))
1663
+ $fields["billing"]["billing_city"]["order"] = $fieldss["billing"]["billing_city"]["order"];
1664
+ $fieldss["billing"]["billing_city"] = $fields["billing"]["billing_city"];
1665
+ }
1666
  $__fields = array();
1667
  if(is_array($fieldss))
1668
  $_fields = $fieldss["billing"];
1675
  if(is_array($_a_) && is_array($fields) ) $fields = (array)$fields + (array)$_a_;
1676
 
1677
  foreach($fields as $key => $value) {
1678
+ if(isset($fields[$v][$key]["order"]))
1679
+ $fields[$v][$key]["priority"] = $value["order"]+10;
1680
  if(isset($fields[$key]["label"]))
1681
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1682
  if(isset($fields[$key]["placeholder"]))
1685
  return $fields;
1686
  }
1687
  function saphali_custom_billing_fields( $fields ) {
1688
+
1689
  if(! isset($this->fieldss) )
1690
  $this->fieldss = get_option('woocommerce_saphali_filds_filters');
1691
  $fieldss = $this->fieldss;
1692
+ if(isset($fieldss["billing"]["billing_city"]) && $fields["billing_city"]["type"] == 'select') {
1693
+ if(isset($fieldss["billing"]["billing_city"]["order"]))
1694
+ $fields["billing_city"]["order"] = $fieldss["billing"]["billing_city"]["order"];
1695
+ $fieldss["billing"]["billing_city"] = $fields["billing_city"];
1696
+ }
1697
 
1698
  if(is_array($fieldss))
1699
  $fields = $fieldss["billing"];
1700
  foreach($fields as $key => $value) {
1701
+ if(isset($fields[$v][$key]["order"]))
1702
+ $fields[$v][$key]["priority"] = $value["order"]+10;
1703
  if(isset($fields[$key]["label"]))
1704
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1705
  if(isset($fields[$key]["placeholder"]))
1706
  $fields[$key]["placeholder"] = __($value["placeholder"], 'woocommerce');
1707
 
1708
  }
1709
+ // var_dump($fields["billing_city"]);
1710
  return $fields;
1711
  }
1712
  function saphali_custom_shipping_fields( $fields ) {
1716
  if(is_array($fieldss))
1717
  $fields = $fieldss["shipping"];
1718
  foreach($fields as $key => $value) {
1719
+ if(isset($fields[$v][$key]["order"]))
1720
+ $fields[$v][$key]["priority"] = $value["order"]+10;
1721
  if(isset($fields[$key]["label"]))
1722
  $fields[$key]["label"] = __($value["label"], 'woocommerce');
1723
  if(isset($fields[$key]["placeholder"]))
1743
  $field_name = '_'.$key;
1744
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1745
  $value_fild = @$order->order_custom_fields[$field_name][0];
1746
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1747
  $value_fild = $order->__get( $key );
1748
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1749
  if ( $value_fild && !empty($field['label']) )
1750
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1751
  endforeach;
1755
  $field_name = '_'.$key;
1756
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1757
  $value_fild = @$order->order_custom_fields[$field_name][0];
1758
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1759
  $value_fild = $order->__get( $key );
1760
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1761
  if ( $value_fild && !empty($field['label']))
1762
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1763
  endforeach;
1768
  $field_name = '_'.$key;
1769
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1770
  $value_fild = @$order->order_custom_fields[$field_name][0];
1771
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1772
  $value_fild = $order->__get( $key );
1773
+ else
1774
+ $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1775
  if ( $value_fild && !empty($field['label']) )
1776
 
1777
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1838
  $field_name = '_'.$key;
1839
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1840
  $value_fild = @$order->order_custom_fields[$field_name][0];
1841
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1842
  $value_fild = $order->__get( $key );
1843
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1844
  if ( $value_fild && !empty($field['label']))
1845
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1846
  endforeach;
1850
  $field_name = '_'.$key;
1851
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1852
  $value_fild = @$order->order_custom_fields[$field_name][0];
1853
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1854
  $value_fild = $order->__get( $key );
1855
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1856
  if ( $value_fild && !empty($field['label']) )
1857
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1858
  endforeach;
1862
  $field_name = '_'.$key;
1863
  if ( version_compare( WOOCOMMERCE_VERSION, '2.1.0', '<' ) )
1864
  $value_fild = @$order->order_custom_fields[$field_name][0];
1865
+ elseif ( version_compare( WOOCOMMERCE_VERSION, '3.0', '<' ) )
1866
  $value_fild = $order->__get( $key );
1867
+ else $value_fild = get_post_meta( $order->get_id(), '_' . $key, true );
1868
  if ( $value_fild && !empty($field['label']) )
1869
  echo '<div class="form-field form-field-wide"><label><strong>'. $field['label']. ':</strong></label> ' . $value_fild.'</div>';
1870
  endforeach;