Version Description
- Fixed a problem with BACS payment gateway strings not being translated in order confirmation page
- Fixed some compatibility issues with WooCommerce Tab Manager
Download this release
Release Info
Developer | mihaimihai |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 3.7.15 |
Comparing to | |
See all releases |
Code changes from version 3.7.14 to 3.7.15
- compatibility/class-wcml-tab-manager.php +20 -8
- inc/products.class.php +30 -24
- inc/wc-strings.class.php +75 -86
- readme.txt +7 -3
- wpml-woocommerce.php +2 -2
compatibility/class-wcml-tab-manager.php
CHANGED
@@ -8,9 +8,10 @@ class WCML_Tab_Manager{
|
|
8 |
add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_tabs' ), 10, 3 );
|
9 |
add_filter( 'wcml_product_content_exception', array( $this, 'is_have_custom_product_tab' ), 10, 3 );
|
10 |
add_filter( 'wcml_custom_box_html', array( $this, 'custom_box_html'), 10, 3 );
|
|
|
11 |
add_filter( 'wpml_duplicate_custom_fields_exceptions', array( $this, 'duplicate_custom_fields_exceptions' ) );
|
12 |
add_action( 'wcml_after_duplicate_product', array( $this, 'duplicate_product_tabs') , 10, 2 );
|
13 |
-
|
14 |
add_filter('wc_tab_manager_tab_id', array($this, 'wc_tab_manager_tab_id'), 10, 1);
|
15 |
|
16 |
if( version_compare( WCML_VERSION, '3.7.2', '>') ){
|
@@ -64,6 +65,8 @@ class WCML_Tab_Manager{
|
|
64 |
$default_language = $woocommerce_wpml->products->get_original_product_language( $original_product_id );
|
65 |
$current_language = $sitepress->get_current_language();
|
66 |
$trnsl_product_tabs[ $key ] = $orig_prod_tabs[ $key ];
|
|
|
|
|
67 |
if( isset( $data[ '_product_tabs_'.$lang ] ) ){
|
68 |
$title = $data[ '_product_tabs_'.$lang ][ 'core_title' ][ $orig_prod_tab[ 'id' ] ];
|
69 |
$heading = $data[ '_product_tabs_'.$lang ][ 'core_heading' ][ $orig_prod_tab[ 'id' ] ];
|
@@ -71,14 +74,17 @@ class WCML_Tab_Manager{
|
|
71 |
|
72 |
if( $default_language != $lang ){
|
73 |
$this->refresh_text_domain( $lang );
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$
|
78 |
-
}
|
79 |
-
|
|
|
|
|
|
|
80 |
}
|
81 |
-
|
82 |
$this->refresh_text_domain( $current_language );
|
83 |
}
|
84 |
|
@@ -501,4 +507,10 @@ class WCML_Tab_Manager{
|
|
501 |
return $tab_id;
|
502 |
}
|
503 |
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
}
|
8 |
add_action( 'wcml_after_duplicate_product_post_meta', array( $this, 'sync_tabs' ), 10, 3 );
|
9 |
add_filter( 'wcml_product_content_exception', array( $this, 'is_have_custom_product_tab' ), 10, 3 );
|
10 |
add_filter( 'wcml_custom_box_html', array( $this, 'custom_box_html'), 10, 3 );
|
11 |
+
add_filter( 'wcml_translatable_custom_fields', array( $this, 'add_translatable_custom_fields') );
|
12 |
add_filter( 'wpml_duplicate_custom_fields_exceptions', array( $this, 'duplicate_custom_fields_exceptions' ) );
|
13 |
add_action( 'wcml_after_duplicate_product', array( $this, 'duplicate_product_tabs') , 10, 2 );
|
14 |
+
|
15 |
add_filter('wc_tab_manager_tab_id', array($this, 'wc_tab_manager_tab_id'), 10, 1);
|
16 |
|
17 |
if( version_compare( WCML_VERSION, '3.7.2', '>') ){
|
65 |
$default_language = $woocommerce_wpml->products->get_original_product_language( $original_product_id );
|
66 |
$current_language = $sitepress->get_current_language();
|
67 |
$trnsl_product_tabs[ $key ] = $orig_prod_tabs[ $key ];
|
68 |
+
$title = '';
|
69 |
+
$heading = '';
|
70 |
if( isset( $data[ '_product_tabs_'.$lang ] ) ){
|
71 |
$title = $data[ '_product_tabs_'.$lang ][ 'core_title' ][ $orig_prod_tab[ 'id' ] ];
|
72 |
$heading = $data[ '_product_tabs_'.$lang ][ 'core_heading' ][ $orig_prod_tab[ 'id' ] ];
|
74 |
|
75 |
if( $default_language != $lang ){
|
76 |
$this->refresh_text_domain( $lang );
|
77 |
+
|
78 |
+
if( !$title ){
|
79 |
+
$title = isset( $_POST['product_tab_title'][ $orig_prod_tab['position'] ] ) ? $_POST['product_tab_title'][ $orig_prod_tab['position'] ] : $orig_prod_tabs[ $key ][ 'title' ];
|
80 |
+
$title = __( $title, 'woocommerce' );
|
81 |
+
}
|
82 |
+
|
83 |
+
if( !$heading && isset( $orig_prod_tabs[ $key ][ 'heading' ] ) ){
|
84 |
+
$heading = isset( $_POST['product_tab_heading'][ $orig_prod_tab['position'] ]) ? $_POST['product_tab_heading'][ $orig_prod_tab['position'] ] : $orig_prod_tabs[ $key ][ 'heading' ];
|
85 |
+
$heading = __( $heading, 'woocommerce' );
|
86 |
}
|
87 |
+
|
88 |
$this->refresh_text_domain( $current_language );
|
89 |
}
|
90 |
|
507 |
return $tab_id;
|
508 |
}
|
509 |
|
510 |
+
function add_translatable_custom_fields( $post_custom_keys ){
|
511 |
+
$post_custom_keys[] = '_product_tabs';
|
512 |
+
return $post_custom_keys;
|
513 |
+
|
514 |
+
}
|
515 |
+
|
516 |
}
|
inc/products.class.php
CHANGED
@@ -1977,20 +1977,22 @@ class WCML_Products{
|
|
1977 |
global $sitepress;
|
1978 |
$settings = $sitepress->get_settings();
|
1979 |
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
|
|
1991 |
}
|
1992 |
-
$contents[] = $meta_key;
|
1993 |
}
|
|
|
|
|
1994 |
}
|
1995 |
|
1996 |
return apply_filters('wcml_product_content_fields', $contents, $product_id );
|
@@ -2017,18 +2019,7 @@ class WCML_Products{
|
|
2017 |
global $sitepress,$wpseo_metabox;
|
2018 |
$settings = $sitepress->get_settings();
|
2019 |
|
2020 |
-
|
2021 |
-
$all_post_custom_keys = get_post_custom_keys($product_id) ;
|
2022 |
-
|
2023 |
-
// filter out not translatable custom fields
|
2024 |
-
$post_custom_keys = array();
|
2025 |
-
foreach( $all_post_custom_keys as $meta_key ){
|
2026 |
-
if(isset($settings['translation-management']['custom_fields_translation'][$meta_key]) && $settings['translation-management']['custom_fields_translation'][$meta_key] == 2){
|
2027 |
-
$post_custom_keys[] = $meta_key;
|
2028 |
-
}
|
2029 |
-
}
|
2030 |
-
|
2031 |
-
$post_custom_keys = apply_filters ( 'wcml_translatable_custom_fields', $post_custom_keys );
|
2032 |
|
2033 |
foreach( $post_custom_keys as $meta_key ){
|
2034 |
|
@@ -2067,6 +2058,21 @@ class WCML_Products{
|
|
2067 |
return apply_filters('wcml_product_content_fields_label', $contents, $product_id);
|
2068 |
}
|
2069 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2070 |
function check_custom_field_is_single_value($product_id,$meta_key){
|
2071 |
|
2072 |
$meta_value = maybe_unserialize( get_post_meta( $product_id, $meta_key, true ) );
|
1977 |
global $sitepress;
|
1978 |
$settings = $sitepress->get_settings();
|
1979 |
|
1980 |
+
$post_custom_keys = $this->wcml_get_translatable_product_custom_fields( $product_id );
|
1981 |
+
|
1982 |
+
foreach($post_custom_keys as $meta_key){
|
1983 |
+
|
1984 |
+
if($this->check_custom_field_is_single_value($product_id,$meta_key)){
|
1985 |
+
if(in_array($meta_key,$this->not_display_fields_for_variables_product)){
|
1986 |
+
continue;
|
1987 |
+
}
|
1988 |
+
}else{
|
1989 |
+
$exception = apply_filters('wcml_product_content_exception',true,$product_id,$meta_key);
|
1990 |
+
if($exception){
|
1991 |
+
continue;
|
1992 |
}
|
|
|
1993 |
}
|
1994 |
+
$contents[] = $meta_key;
|
1995 |
+
|
1996 |
}
|
1997 |
|
1998 |
return apply_filters('wcml_product_content_fields', $contents, $product_id );
|
2019 |
global $sitepress,$wpseo_metabox;
|
2020 |
$settings = $sitepress->get_settings();
|
2021 |
|
2022 |
+
$post_custom_keys = $this->wcml_get_translatable_product_custom_fields( $product_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023 |
|
2024 |
foreach( $post_custom_keys as $meta_key ){
|
2025 |
|
2058 |
return apply_filters('wcml_product_content_fields_label', $contents, $product_id);
|
2059 |
}
|
2060 |
|
2061 |
+
|
2062 |
+
function wcml_get_translatable_product_custom_fields( $product_id ){
|
2063 |
+
$all_post_custom_keys = get_post_custom_keys($product_id) ;
|
2064 |
+
|
2065 |
+
// filter out not translatable custom fields
|
2066 |
+
$post_custom_keys = array();
|
2067 |
+
foreach( $all_post_custom_keys as $meta_key ){
|
2068 |
+
if(isset($settings['translation-management']['custom_fields_translation'][$meta_key]) && $settings['translation-management']['custom_fields_translation'][$meta_key] == 2){
|
2069 |
+
$post_custom_keys[] = $meta_key;
|
2070 |
+
}
|
2071 |
+
}
|
2072 |
+
|
2073 |
+
return apply_filters ( 'wcml_translatable_custom_fields', $post_custom_keys );
|
2074 |
+
}
|
2075 |
+
|
2076 |
function check_custom_field_is_single_value($product_id,$meta_key){
|
2077 |
|
2078 |
$meta_value = maybe_unserialize( get_post_meta( $product_id, $meta_key, true ) );
|
inc/wc-strings.class.php
CHANGED
@@ -9,7 +9,6 @@ class WCML_WC_Strings{
|
|
9 |
function __construct(){
|
10 |
|
11 |
add_action( 'init', array( $this, 'init' ) );
|
12 |
-
add_action( 'init', array( $this, 'pre_init' ) );
|
13 |
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
14 |
add_filter( 'wp_redirect', array( $this, 'encode_shop_slug' ), 10, 2 );
|
15 |
add_action( 'registered_taxonomy', array ( $this, 'translate_attributes_label_in_wp_taxonomies' ), 100, 3 );
|
@@ -17,6 +16,58 @@ class WCML_WC_Strings{
|
|
17 |
add_action('wp_ajax_woocommerce_shipping_zone_methods_save_settings', array( $this, 'save_shipping_zone_method_from_ajax'), 9);
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
function payment_gateways_filters( ){
|
21 |
|
22 |
$payment_gateways = WC()->payment_gateways()->payment_gateways;
|
@@ -26,10 +77,10 @@ class WCML_WC_Strings{
|
|
26 |
$gateway_id = $gateway->id;
|
27 |
}else{
|
28 |
continue;
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
|
35 |
function shipping_methods_filters( ){
|
@@ -71,62 +122,6 @@ class WCML_WC_Strings{
|
|
71 |
return $instance_settings;
|
72 |
}
|
73 |
|
74 |
-
function pre_init(){
|
75 |
-
// Slug translation
|
76 |
-
if( !WPML_SUPPORT_STRINGS_IN_DIFF_LANG ){
|
77 |
-
add_filter('gettext_with_context', array($this, 'translate_default_slug'), 2, 4);
|
78 |
-
}
|
79 |
-
|
80 |
-
}
|
81 |
-
|
82 |
-
function init(){
|
83 |
-
global $pagenow, $sitepress;
|
84 |
-
|
85 |
-
$this->payment_gateways_filters();
|
86 |
-
$this->shipping_methods_filters();
|
87 |
-
|
88 |
-
$this->current_language = $sitepress->get_current_language();
|
89 |
-
if( $this->current_language == 'all' ){
|
90 |
-
$this->current_language = $sitepress->get_default_language();
|
91 |
-
}
|
92 |
-
|
93 |
-
add_filter('woocommerce_package_rates', array($this, 'translate_shipping_methods_in_package'));
|
94 |
-
add_action('woocommerce_tax_rate_added', array($this, 'register_tax_rate_label_string'), 10, 2 );
|
95 |
-
add_filter('woocommerce_rate_label',array($this,'translate_woocommerce_rate_label'));
|
96 |
-
|
97 |
-
add_filter('woocommerce_gateway_title', array($this, 'translate_gateway_title'), 10, 2);
|
98 |
-
add_filter('woocommerce_gateway_description', array($this, 'translate_gateway_description'), 10, 2);
|
99 |
-
|
100 |
-
//translate attribute label
|
101 |
-
add_filter('woocommerce_attribute_label',array($this,'translated_attribute_label'),10,3);
|
102 |
-
add_filter('woocommerce_cart_item_name',array($this,'translated_cart_item_name'),10,3);
|
103 |
-
add_filter('woocommerce_checkout_product_title',array($this,'translated_checkout_product_title'),10,2);
|
104 |
-
|
105 |
-
if(is_admin() && $pagenow == 'options-permalink.php'){
|
106 |
-
add_filter( 'gettext_with_context', array( $this, 'category_base_in_strings_language' ), 99, 3 );
|
107 |
-
|
108 |
-
if( WPML_SUPPORT_STRINGS_IN_DIFF_LANG ) {
|
109 |
-
add_action( 'admin_footer', array( $this, 'show_custom_url_base_translation_links' ) );
|
110 |
-
}
|
111 |
-
|
112 |
-
add_action('admin_footer', array($this, 'show_custom_url_base_language_requirement'));
|
113 |
-
}
|
114 |
-
|
115 |
-
if(is_admin() && $pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == 'wc-settings'){
|
116 |
-
add_action('admin_footer', array($this, 'show_language_notice_for_wc_settings'));
|
117 |
-
}
|
118 |
-
|
119 |
-
if(is_admin() && $pagenow == 'edit.php' && isset($_GET['page']) && $_GET['page'] == 'woocommerce_attributes'){
|
120 |
-
add_action('admin_footer', array($this, 'show_attribute_label_language_warning'));
|
121 |
-
}
|
122 |
-
|
123 |
-
add_action( 'woocommerce_product_options_attributes', array ( $this, 'notice_after_woocommerce_product_options_attributes' ) );
|
124 |
-
|
125 |
-
add_filter( 'woocommerce_attribute_taxonomies', array( $this, 'translate_attribute_taxonomies_labels') );
|
126 |
-
|
127 |
-
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_woocommerce_breadcrumbs' ), 10, 2 );
|
128 |
-
}
|
129 |
-
|
130 |
function translated_attribute_label($label, $name, $product_obj = false){
|
131 |
global $sitepress,$product;
|
132 |
|
@@ -348,6 +343,7 @@ class WCML_WC_Strings{
|
|
348 |
|
349 |
function translate_shipping_method_title( $title, $shipping_id ) {
|
350 |
|
|
|
351 |
$title = apply_filters( 'wpml_translate_single_string', $title, 'woocommerce', $shipping_id .'_shipping_method_title', $this->current_language );
|
352 |
|
353 |
return $title;
|
@@ -373,7 +369,7 @@ class WCML_WC_Strings{
|
|
373 |
$wc_payment_gateways = WC_Payment_Gateways::instance();
|
374 |
|
375 |
foreach( $wc_payment_gateways->payment_gateways() as $gateway ){
|
376 |
-
if( isset( $_POST['woocommerce_'.$gateway->id.'_enabled'] ) ){
|
377 |
$gateway_id = $gateway->id;
|
378 |
break;
|
379 |
}
|
@@ -395,43 +391,36 @@ class WCML_WC_Strings{
|
|
395 |
}
|
396 |
|
397 |
|
398 |
-
function translate_gateway_strings( $
|
399 |
-
|
400 |
-
if( $option && isset( $value['enabled']) && $value['enabled'] == 'no' ){
|
401 |
-
return $value;
|
402 |
-
}
|
403 |
|
404 |
-
$
|
405 |
-
$gateway_id = str_replace( '_settings', '', $gateway_id );
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
|
415 |
-
|
416 |
-
|
|
|
417 |
}
|
418 |
-
|
419 |
-
return $value;
|
420 |
-
|
421 |
}
|
422 |
|
423 |
-
function translate_gateway_title($title, $
|
424 |
-
$title = apply_filters( 'wpml_translate_single_string', $title, 'woocommerce', $
|
425 |
return $title;
|
426 |
}
|
427 |
|
428 |
-
function translate_gateway_description( $description, $
|
429 |
-
$description = apply_filters( 'wpml_translate_single_string', $description, 'woocommerce', $
|
430 |
return $description;
|
431 |
}
|
432 |
|
433 |
-
function translate_gateway_instructions( $
|
434 |
-
$instructions = apply_filters( 'wpml_translate_single_string', $instructions, 'woocommerce', $
|
435 |
return $instructions;
|
436 |
}
|
437 |
|
9 |
function __construct(){
|
10 |
|
11 |
add_action( 'init', array( $this, 'init' ) );
|
|
|
12 |
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
13 |
add_filter( 'wp_redirect', array( $this, 'encode_shop_slug' ), 10, 2 );
|
14 |
add_action( 'registered_taxonomy', array ( $this, 'translate_attributes_label_in_wp_taxonomies' ), 100, 3 );
|
16 |
add_action('wp_ajax_woocommerce_shipping_zone_methods_save_settings', array( $this, 'save_shipping_zone_method_from_ajax'), 9);
|
17 |
}
|
18 |
|
19 |
+
function init(){
|
20 |
+
global $pagenow, $sitepress;
|
21 |
+
|
22 |
+
// Slug translation
|
23 |
+
if( !WPML_SUPPORT_STRINGS_IN_DIFF_LANG ){
|
24 |
+
add_filter('gettext_with_context', array($this, 'translate_default_slug'), 2, 4);
|
25 |
+
}
|
26 |
+
$this->payment_gateways_filters();
|
27 |
+
$this->shipping_methods_filters();
|
28 |
+
|
29 |
+
$this->current_language = $sitepress->get_current_language();
|
30 |
+
if( $this->current_language == 'all' ){
|
31 |
+
$this->current_language = $sitepress->get_default_language();
|
32 |
+
}
|
33 |
+
|
34 |
+
add_filter('woocommerce_package_rates', array($this, 'translate_shipping_methods_in_package'));
|
35 |
+
add_action('woocommerce_tax_rate_added', array($this, 'register_tax_rate_label_string'), 10, 2 );
|
36 |
+
add_filter('woocommerce_rate_label',array($this,'translate_woocommerce_rate_label'));
|
37 |
+
|
38 |
+
add_filter('woocommerce_gateway_title', array($this, 'translate_gateway_title'), 10, 2);
|
39 |
+
add_filter('woocommerce_gateway_description', array($this, 'translate_gateway_description'), 10, 2);
|
40 |
+
|
41 |
+
//translate attribute label
|
42 |
+
add_filter('woocommerce_attribute_label',array($this,'translated_attribute_label'),10,3);
|
43 |
+
add_filter('woocommerce_cart_item_name',array($this,'translated_cart_item_name'),10,3);
|
44 |
+
add_filter('woocommerce_checkout_product_title',array($this,'translated_checkout_product_title'),10,2);
|
45 |
+
|
46 |
+
if(is_admin() && $pagenow == 'options-permalink.php'){
|
47 |
+
add_filter( 'gettext_with_context', array( $this, 'category_base_in_strings_language' ), 99, 3 );
|
48 |
+
|
49 |
+
if( WPML_SUPPORT_STRINGS_IN_DIFF_LANG ) {
|
50 |
+
add_action( 'admin_footer', array( $this, 'show_custom_url_base_translation_links' ) );
|
51 |
+
}
|
52 |
+
|
53 |
+
add_action('admin_footer', array($this, 'show_custom_url_base_language_requirement'));
|
54 |
+
}
|
55 |
+
|
56 |
+
if(is_admin() && $pagenow == 'admin.php' && isset($_GET['page']) && $_GET['page'] == 'wc-settings'){
|
57 |
+
add_action('admin_footer', array($this, 'show_language_notice_for_wc_settings'));
|
58 |
+
}
|
59 |
+
|
60 |
+
if(is_admin() && $pagenow == 'edit.php' && isset($_GET['page']) && $_GET['page'] == 'woocommerce_attributes'){
|
61 |
+
add_action('admin_footer', array($this, 'show_attribute_label_language_warning'));
|
62 |
+
}
|
63 |
+
|
64 |
+
add_action( 'woocommerce_product_options_attributes', array ( $this, 'notice_after_woocommerce_product_options_attributes' ) );
|
65 |
+
|
66 |
+
add_filter( 'woocommerce_attribute_taxonomies', array( $this, 'translate_attribute_taxonomies_labels') );
|
67 |
+
|
68 |
+
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_woocommerce_breadcrumbs' ), 10, 2 );
|
69 |
+
}
|
70 |
+
|
71 |
function payment_gateways_filters( ){
|
72 |
|
73 |
$payment_gateways = WC()->payment_gateways()->payment_gateways;
|
77 |
$gateway_id = $gateway->id;
|
78 |
}else{
|
79 |
continue;
|
80 |
+
}
|
81 |
+
add_filter( 'woocommerce_settings_api_sanitized_fields_'.$gateway_id, array( $this, 'register_gateway_strings' ) );
|
82 |
+
$this->translate_gateway_strings( $gateway );
|
83 |
+
}
|
84 |
}
|
85 |
|
86 |
function shipping_methods_filters( ){
|
122 |
return $instance_settings;
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
function translated_attribute_label($label, $name, $product_obj = false){
|
126 |
global $sitepress,$product;
|
127 |
|
343 |
|
344 |
function translate_shipping_method_title( $title, $shipping_id ) {
|
345 |
|
346 |
+
$shipping_id = str_replace( ':', '', $shipping_id );
|
347 |
$title = apply_filters( 'wpml_translate_single_string', $title, 'woocommerce', $shipping_id .'_shipping_method_title', $this->current_language );
|
348 |
|
349 |
return $title;
|
369 |
$wc_payment_gateways = WC_Payment_Gateways::instance();
|
370 |
|
371 |
foreach( $wc_payment_gateways->payment_gateways() as $gateway ){
|
372 |
+
if( isset( $_POST['woocommerce_'.$gateway->id.'_enabled'] ) || isset( $_POST[ $gateway->id.'_enabled'] ) ){
|
373 |
$gateway_id = $gateway->id;
|
374 |
break;
|
375 |
}
|
391 |
}
|
392 |
|
393 |
|
394 |
+
function translate_gateway_strings( $gateway ){
|
|
|
|
|
|
|
|
|
395 |
|
396 |
+
if( isset( $gateway->enabled ) && $gateway->enabled != 'no' ) {
|
|
|
397 |
|
398 |
+
if (isset($gateway->instructions)) {
|
399 |
+
$gateway->instructions = $this->translate_gateway_instructions( $gateway->instructions, $gateway->id );
|
400 |
+
}
|
401 |
|
402 |
+
if (isset($gateway->description)) {
|
403 |
+
$gateway->description = $this->translate_gateway_description($gateway->description, $gateway->id);
|
404 |
+
}
|
405 |
|
406 |
+
if (isset($gateway->title)) {
|
407 |
+
$gateway->title = $this->translate_gateway_title($gateway->title, $gateway->id);
|
408 |
+
}
|
409 |
}
|
|
|
|
|
|
|
410 |
}
|
411 |
|
412 |
+
function translate_gateway_title($title, $gateway_id) {
|
413 |
+
$title = apply_filters( 'wpml_translate_single_string', $title, 'woocommerce', $gateway_id .'_gateway_title', $this->current_language );
|
414 |
return $title;
|
415 |
}
|
416 |
|
417 |
+
function translate_gateway_description( $description, $gateway_id) {
|
418 |
+
$description = apply_filters( 'wpml_translate_single_string', $description, 'woocommerce', $gateway_id . '_gateway_description', $this->current_language );
|
419 |
return $description;
|
420 |
}
|
421 |
|
422 |
+
function translate_gateway_instructions( $instructions, $gateway_id){
|
423 |
+
$instructions = apply_filters( 'wpml_translate_single_string', $instructions, 'woocommerce', $gateway_id . '_gateway_instructions', $this->current_language );
|
424 |
return $instructions;
|
425 |
}
|
426 |
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
=== WooCommerce Multilingual - run WooCommerce with WPML ===
|
2 |
Contributors: AmirHelzer, dominykasgel, dgwatkins, adelval
|
3 |
Donate link: http://wpml.org/documentation/related-projects/woocommerce-multilingual/
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.0
|
7 |
-
Tested up to: 4.5.
|
8 |
-
Stable tag: 3.7.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -78,6 +78,10 @@ In order for the checkout and store pages to appear translated, you need to crea
|
|
78 |
|
79 |
== Changelog ==
|
80 |
|
|
|
|
|
|
|
|
|
81 |
= 3.7.14 =
|
82 |
* Fixed a problem introduced in the previous version: Mollie payment methods not working when using the 'Mollie Payments for WooCommerce' plugin
|
83 |
|
1 |
+
=== WooCommerce Multilingual - run WooCommerce with WPML ===
|
2 |
Contributors: AmirHelzer, dominykasgel, dgwatkins, adelval
|
3 |
Donate link: http://wpml.org/documentation/related-projects/woocommerce-multilingual/
|
4 |
Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multilingual, e-shop, shop
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.0
|
7 |
+
Tested up to: 4.5.2
|
8 |
+
Stable tag: 3.7.15
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 3.7.15 =
|
82 |
+
* Fixed a problem with BACS payment gateway strings not being translated in order confirmation page
|
83 |
+
* Fixed some compatibility issues with WooCommerce Tab Manager
|
84 |
+
|
85 |
= 3.7.14 =
|
86 |
* Fixed a problem introduced in the previous version: Mollie payment methods not working when using the 'Mollie Payments for WooCommerce' plugin
|
87 |
|
wpml-woocommerce.php
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
-
Version: 3.7.
|
10 |
*/
|
11 |
|
12 |
|
13 |
if(defined('WCML_VERSION')) return;
|
14 |
-
define('WCML_VERSION', '3.7.
|
15 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
16 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
17 |
define('WCML_LOCALE_PATH', WCML_PLUGIN_PATH.'/locale');
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
+
Version: 3.7.15
|
10 |
*/
|
11 |
|
12 |
|
13 |
if(defined('WCML_VERSION')) return;
|
14 |
+
define('WCML_VERSION', '3.7.15');
|
15 |
define('WCML_PLUGIN_PATH', dirname(__FILE__));
|
16 |
define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
|
17 |
define('WCML_LOCALE_PATH', WCML_PLUGIN_PATH.'/locale');
|