WooCommerce Multilingual – run WooCommerce with WPML - Version 3.4.3

Version Description

  • Bug fixed: Incorrect decimal separator for prices on WordPress admin
  • Bug fixed: Insert link button not working on products translator interface.
  • Bug fixed: Switching currency after adding to cart was adding an additional item
  • Bug fixed: Review setting not preserved on translation of variable product
  • Bug fixed: Visible on the products page option for product attributes was still selectable for product translation.
  • Bug fixed: Translation status icon not updated on products translator page
  • Bug fixed: Shipping rate was lost when WPML is activated
  • Bug fixed: WooCommerce sort by links going to blog not products
  • Bug fixed: Option to select currency position was missing immediately after a new currency was added
Download this release

Release Info

Developer mihaimihai
Plugin Icon 128x128 WooCommerce Multilingual – run WooCommerce with WPML
Version 3.4.3
Comparing to
See all releases

Code changes from version 3.4.2 to 3.4.3

assets/js/lock_fields.js CHANGED
@@ -13,7 +13,7 @@ jQuery(document).ready(function($){
13
  $('.'+buttons[i]).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
14
  }
15
 
16
- $('.remove_variation,.attribute_name,.woocommerce_attribute_data td textarea').each(function(){
17
  $(this).attr('disabled','disabled');
18
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
19
  });
@@ -24,12 +24,12 @@ jQuery(document).ready(function($){
24
  $('input[name="'+inpt_names[i]+'"]').after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
25
  }
26
 
27
- $('.woocommerce_variation input[type="text"],.woocommerce_variation input[type="checkbox"],.woocommerce_variation input[type="number"],.woocommerce_attribute_data input[type="checkbox"]').each(function(){
28
  $(this).attr('readonly','readonly');
29
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
30
  });
31
 
32
- $('.woocommerce_variation select,#variable_product_options .toolbar select,.attribute_values').each(function(){
33
  $(this).attr('disabled','disabled');
34
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
35
  });
@@ -38,6 +38,9 @@ jQuery(document).ready(function($){
38
  for (i = 0; i < ids.length; i++) {
39
  $('#'+ids[i]).removeAttr('disabled');
40
  }
 
 
 
41
  });
42
 
43
 
13
  $('.'+buttons[i]).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
14
  }
15
 
16
+ $('.remove_variation,.attribute_name').each(function(){
17
  $(this).attr('disabled','disabled');
18
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show().css('float','right'));
19
  });
24
  $('input[name="'+inpt_names[i]+'"]').after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
25
  }
26
 
27
+ $('.woocommerce_variation input[type="text"],.woocommerce_variation input[type="number"],.woocommerce_attribute_data td textarea,.attribute_values').each(function(){
28
  $(this).attr('readonly','readonly');
29
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
30
  });
31
 
32
+ $('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],.woocommerce_attribute_data input[type="checkbox"]').each(function(){
33
  $(this).attr('disabled','disabled');
34
  $(this).after($('.wcml_lock_img').clone().removeClass('wcml_lock_img').show());
35
  });
38
  for (i = 0; i < ids.length; i++) {
39
  $('#'+ids[i]).removeAttr('disabled');
40
  }
41
+ $('.woocommerce_variation select,#variable_product_options .toolbar select,.woocommerce_variation input[type="checkbox"],.woocommerce_attribute_data input[type="checkbox"]').each(function(){
42
+ $(this).removeAttr('disabled');
43
+ });
44
  });
45
 
46
 
assets/js/scripts.js CHANGED
@@ -1045,8 +1045,8 @@ jQuery(document).ready(function($){
1045
  parent.find('.currency_code .currency_value span').html(response.currency_meta_info);
1046
 
1047
  parent.find('.currency_code').prepend(response.currency_options);
1048
-
1049
- parent.find('.currency_code select').remove();
1050
  parent.find('.currency_value input').remove();
1051
 
1052
  parent.find('.edit_currency').data('currency', currency_code).show();
1045
  parent.find('.currency_code .currency_value span').html(response.currency_meta_info);
1046
 
1047
  parent.find('.currency_code').prepend(response.currency_options);
1048
+
1049
+ parent.find('.currency_code select[name="code"]').remove();
1050
  parent.find('.currency_value input').remove();
1051
 
1052
  parent.find('.edit_currency').data('currency', currency_code).show();
inc/emails.class.php CHANGED
@@ -26,6 +26,8 @@ class WCML_Emails{
26
 
27
  //WPML job link
28
  add_filter('icl_job_edit_url',array($this,'icl_job_edit_url'),10 ,2);
 
 
29
 
30
  //change order status
31
  add_action('woocommerce_order_status_completed',array($this,'refresh_email_lang'),9);
@@ -260,4 +262,18 @@ class WCML_Emails{
260
 
261
  }
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  }
26
 
27
  //WPML job link
28
  add_filter('icl_job_edit_url',array($this,'icl_job_edit_url'),10 ,2);
29
+ //filter string language before for emails
30
+ add_filter('icl_current_string_language',array($this,'icl_current_string_language'),10 ,2);
31
 
32
  //change order status
33
  add_action('woocommerce_order_status_completed',array($this,'refresh_email_lang'),9);
262
 
263
  }
264
 
265
+ function icl_current_string_language( $current_language, $name ){
266
+ if( isset($_POST['action']) && $_POST['action'] == 'editpost' && isset($_POST['post_type']) && $_POST['post_type'] == 'shop_order' ){
267
+ $order_language = get_post_meta($_POST['post_ID'],'wpml_language',true);
268
+ if($order_language){
269
+ return $order_language;
270
+ }else{
271
+ global $sitepress;
272
+ return $sitepress->get_current_language();
273
+ }
274
+ }
275
+
276
+ return $current_language;
277
+ }
278
+
279
  }
inc/multi-currency-support.class.php CHANGED
@@ -13,7 +13,7 @@ class WCML_Multi_Currency_Support{
13
 
14
  add_action('init', array($this, 'init'), 5);
15
  //add_action('wp_head', array($this, 'set_default_currency')); //@todo - review
16
-
17
 
18
  if(is_ajax()){
19
  add_action('wp_ajax_nopriv_wcml_switch_currency', array($this, 'switch_currency'));
@@ -66,7 +66,6 @@ class WCML_Multi_Currency_Support{
66
 
67
  function init(){
68
 
69
- $this->init_currencies();
70
 
71
  if($this->_load_filters()){
72
 
@@ -88,17 +87,16 @@ class WCML_Multi_Currency_Support{
88
  add_filter('woocommerce_table_rate_instance_settings', array($this, 'table_rate_instance_settings'));
89
  }
90
 
91
-
92
- add_filter('option_woocommerce_price_thousand_sep', array($this, 'filter_currency_thousand_sep_option'));
93
- add_filter('option_woocommerce_price_decimal_sep', array($this, 'filter_currency_decimal_sep_option'));
94
- add_filter('option_woocommerce_price_num_decimals', array($this, 'filter_currency_num_decimals_option'));
95
-
96
  //filters for wc-widget-price-filter
97
  add_filter( 'woocommerce_price_filter_results', array( $this, 'filter_price_filter_results' ), 10, 3 );
98
  add_filter( 'woocommerce_price_filter_widget_amount', array( $this, 'filter_price_filter_widget_amount' ) );
99
 
100
  }
101
-
 
 
 
 
102
  add_filter('option_woocommerce_currency_pos', array($this, 'filter_currency_position_option'));
103
  add_filter( 'woocommerce_get_formatted_order_total', array( $this, 'filter_get_formatted_order_total' ), 10, 2 );
104
  add_action( 'woocommerce_view_order', array( $this, 'filter_view_order' ), 9 );
@@ -229,10 +227,11 @@ class WCML_Multi_Currency_Support{
229
  $return['currency_name_formatted_without_rate'] = sprintf('%s (%s)', $wc_currencies[$currency_code], get_woocommerce_currency_symbol($currency_code));
230
  $return['currency_meta_info'] = sprintf('1 %s = %s %s', $wc_currency, $settings['currency_options'][$currency_code]['rate'], $currency_code);
231
 
232
- ob_start();
233
  $code = $currency_code;
234
  $this->init_currencies();
235
  $currency = $this->currencies[$currency_code];
 
236
  include WCML_PLUGIN_PATH . '/menu/sub/custom-currency-options.php';
237
  $return['currency_options'] = ob_get_contents();
238
  ob_end_clean();
@@ -579,13 +578,21 @@ class WCML_Multi_Currency_Support{
579
  function load_currency(currency){
580
  var ajax_loader = jQuery('<img style=\"margin-left:10px;\" width=\"16\" heigth=\"16\" src=\"" . WCML_PLUGIN_URL . "/assets/images/ajax-loader.gif\" />')
581
  jQuery('.wcml_currency_switcher').attr('disabled', 'disabled');
582
- jQuery('.wcml_currency_switcher').after()
583
  ajax_loader.insertAfter(jQuery('.wcml_currency_switcher'));
584
  var data = {action: 'wcml_switch_currency', currency: currency}
585
- jQuery.post(woocommerce_params.ajax_url, data, function(){
586
- jQuery('.wcml_currency_switcher').removeAttr('disabled');
 
 
 
 
 
 
 
587
  ajax_loader.remove();
588
- location.reload();
 
589
  });
590
  }
591
  " );
@@ -988,45 +995,24 @@ class WCML_Multi_Currency_Support{
988
  if(isset($_POST['action']) && $_POST['action'] == 'wcml_switch_currency' && !empty($_POST['currency'])){
989
  return $this->client_currency = $_POST['currency'];
990
  }
991
-
992
-
993
- if(empty($this->client_currency) && !empty($woocommerce->session)){
994
- $session_currency = $woocommerce->session->get('client_currency_' . $current_language);
995
- if(isset($this->currencies[$session_currency]) && !empty($this->currencies[$session_currency]['languages'][$current_language])){
996
- $this->client_currency = $session_currency;
997
- }
998
- }
999
-
1000
- if(!$this->client_currency && $default_currencies[$current_language]){
1001
  $this->client_currency = $default_currencies[$current_language];
1002
- if(!empty($woocommerce->session)){
1003
- $woocommerce->session->set('client_currency_' . $current_language, $this->client_currency);
1004
- }
1005
- }
1006
-
1007
- //reset other languages
1008
- if(!$this->client_currency && !empty($woocommerce->session)){
1009
- foreach($active_languages as $language){
1010
- if($language['code'] != $current_language){
1011
- $woocommerce->session->__unset('client_currency_' . $current_language);
1012
- }
1013
- }
1014
  }
1015
-
1016
- if(empty($this->client_currency)){
1017
-
1018
  // client currency in general / if enabled for this language
1019
- if( !empty($woocommerce->session) ){
 
1020
  $session_currency = $woocommerce->session->get('client_currency');
1021
  if($session_currency && !empty($this->currencies[$session_currency]['languages'][$current_language])){
1022
- $this->client_currency = $woocommerce->session->get('client_currency');
1023
  }
1024
-
1025
  }
1026
-
1027
  if(is_null($this->client_currency)){
1028
  $woocommerce_currency = get_option('woocommerce_currency');
1029
-
1030
  // fall on WC currency if enabled for this language
1031
  if(!empty($this->currencies[$woocommerce_currency]['languages'][$current_language])){
1032
  $this->client_currency = $woocommerce_currency;
@@ -1035,17 +1021,17 @@ class WCML_Multi_Currency_Support{
1035
  foreach($this->currencies as $code => $data){
1036
  if(!empty($data['languages'][$current_language])){
1037
  $this->client_currency = $code;
1038
- break;
1039
- }
1040
  }
1041
  }
1042
-
1043
- if(!empty($woocommerce->session)){
1044
- $woocommerce->session->set('client_currency', $this->client_currency);
1045
  }
1046
  }
 
 
 
1047
  }
1048
-
 
1049
  return apply_filters('wcml_client_currency', $this->client_currency);
1050
  }
1051
 
13
 
14
  add_action('init', array($this, 'init'), 5);
15
  //add_action('wp_head', array($this, 'set_default_currency')); //@todo - review
16
+ $this->init_currencies();
17
 
18
  if(is_ajax()){
19
  add_action('wp_ajax_nopriv_wcml_switch_currency', array($this, 'switch_currency'));
66
 
67
  function init(){
68
 
 
69
 
70
  if($this->_load_filters()){
71
 
87
  add_filter('woocommerce_table_rate_instance_settings', array($this, 'table_rate_instance_settings'));
88
  }
89
 
 
 
 
 
 
90
  //filters for wc-widget-price-filter
91
  add_filter( 'woocommerce_price_filter_results', array( $this, 'filter_price_filter_results' ), 10, 3 );
92
  add_filter( 'woocommerce_price_filter_widget_amount', array( $this, 'filter_price_filter_widget_amount' ) );
93
 
94
  }
95
+
96
+ add_filter('option_woocommerce_price_thousand_sep', array($this, 'filter_currency_thousand_sep_option'));
97
+ add_filter('option_woocommerce_price_decimal_sep', array($this, 'filter_currency_decimal_sep_option'));
98
+ add_filter('option_woocommerce_price_num_decimals', array($this, 'filter_currency_num_decimals_option'));
99
+
100
  add_filter('option_woocommerce_currency_pos', array($this, 'filter_currency_position_option'));
101
  add_filter( 'woocommerce_get_formatted_order_total', array( $this, 'filter_get_formatted_order_total' ), 10, 2 );
102
  add_action( 'woocommerce_view_order', array( $this, 'filter_view_order' ), 9 );
227
  $return['currency_name_formatted_without_rate'] = sprintf('%s (%s)', $wc_currencies[$currency_code], get_woocommerce_currency_symbol($currency_code));
228
  $return['currency_meta_info'] = sprintf('1 %s = %s %s', $wc_currency, $settings['currency_options'][$currency_code]['rate'], $currency_code);
229
 
230
+
231
  $code = $currency_code;
232
  $this->init_currencies();
233
  $currency = $this->currencies[$currency_code];
234
+ ob_start();
235
  include WCML_PLUGIN_PATH . '/menu/sub/custom-currency-options.php';
236
  $return['currency_options'] = ob_get_contents();
237
  ob_end_clean();
578
  function load_currency(currency){
579
  var ajax_loader = jQuery('<img style=\"margin-left:10px;\" width=\"16\" heigth=\"16\" src=\"" . WCML_PLUGIN_URL . "/assets/images/ajax-loader.gif\" />')
580
  jQuery('.wcml_currency_switcher').attr('disabled', 'disabled');
581
+ jQuery('.wcml_currency_switcher').after();
582
  ajax_loader.insertAfter(jQuery('.wcml_currency_switcher'));
583
  var data = {action: 'wcml_switch_currency', currency: currency}
584
+ jQuery.ajax({
585
+ type : 'post',
586
+ url : woocommerce_params.ajax_url,
587
+ data : {
588
+ action: 'wcml_switch_currency',
589
+ currency : currency
590
+ },
591
+ success: function(response) {
592
+ jQuery('.wcml_currency_switcher').removeAttr('disabled');
593
  ajax_loader.remove();
594
+ window.location = window.location.href;
595
+ }
596
  });
597
  }
598
  " );
995
  if(isset($_POST['action']) && $_POST['action'] == 'wcml_switch_currency' && !empty($_POST['currency'])){
996
  return $this->client_currency = $_POST['currency'];
997
  }
998
+
999
+ if( is_null($this->client_currency) && isset($default_currencies[$current_language]) && $default_currencies[$current_language] ){
 
 
 
 
 
 
 
 
1000
  $this->client_currency = $default_currencies[$current_language];
 
 
 
 
 
 
 
 
 
 
 
 
1001
  }
1002
+
 
 
1003
  // client currency in general / if enabled for this language
1004
+
1005
+ if(is_null($this->client_currency) && !empty($woocommerce->session) ){
1006
  $session_currency = $woocommerce->session->get('client_currency');
1007
  if($session_currency && !empty($this->currencies[$session_currency]['languages'][$current_language])){
1008
+ $this->client_currency = $woocommerce->session->get('client_currency');
1009
  }
1010
+
1011
  }
1012
+
1013
  if(is_null($this->client_currency)){
1014
  $woocommerce_currency = get_option('woocommerce_currency');
1015
+
1016
  // fall on WC currency if enabled for this language
1017
  if(!empty($this->currencies[$woocommerce_currency]['languages'][$current_language])){
1018
  $this->client_currency = $woocommerce_currency;
1021
  foreach($this->currencies as $code => $data){
1022
  if(!empty($data['languages'][$current_language])){
1023
  $this->client_currency = $code;
1024
+ break;
 
1025
  }
1026
  }
 
 
 
1027
  }
1028
  }
1029
+
1030
+ if(!empty($woocommerce->session) && $this->client_currency){
1031
+ $woocommerce->session->set('client_currency', $this->client_currency);
1032
  }
1033
+
1034
+
1035
  return apply_filters('wcml_client_currency', $this->client_currency);
1036
  }
1037
 
inc/multi-currency.class.php CHANGED
@@ -16,6 +16,7 @@ class WCML_WC_MultiCurrency{
16
  function __construct(){
17
 
18
  add_filter('init', array($this, 'init'), 5);
 
19
 
20
  }
21
 
@@ -122,7 +123,11 @@ class WCML_WC_MultiCurrency{
122
  }
123
 
124
  function raw_price_filter($price, $product_id = false) {
125
-
 
 
 
 
126
  $price = $this->convert_price_amount($price, $this->get_client_currency());
127
 
128
  $price = $this->apply_rounding_rules($price);
16
  function __construct(){
17
 
18
  add_filter('init', array($this, 'init'), 5);
19
+ add_filter('woocommerce_adjust_price', array($this, 'raw_price_filter'), 10, 2);
20
 
21
  }
22
 
123
  }
124
 
125
  function raw_price_filter($price, $product_id = false) {
126
+
127
+ if( is_object($product_id) ){
128
+ $product_id = $product_id->id;
129
+ }
130
+
131
  $price = $this->convert_price_amount($price, $this->get_client_currency());
132
 
133
  $price = $this->apply_rounding_rules($price);
inc/products.class.php CHANGED
@@ -152,7 +152,12 @@ class WCML_Products{
152
  */
153
  function get_product_list($page = 1,$limit = 20){
154
  global $wpdb,$sitepress;
155
- $products = $wpdb->get_results($wpdb->prepare("SELECT p.ID,p.post_parent FROM $wpdb->posts AS p LEFT JOIN {$wpdb->prefix}icl_translations AS icl ON icl.element_id = p.id WHERE p.post_type = 'product' AND p.post_status IN ('publish','future','draft','pending','private') AND icl.element_type= 'post_product' AND icl.language_code = %s",$sitepress->get_current_language()));
 
 
 
 
 
156
 
157
  return $this->display_hierarchical($products,$page,$limit);
158
  }
@@ -523,6 +528,8 @@ class WCML_Products{
523
  $args['post_content'] = $data['content_' . $language];
524
  $args['post_excerpt'] = $data['excerpt_' . $language];
525
  $args['post_status'] = $orig_product->post_status;
 
 
526
  $product_parent = icl_object_id($orig_product->post_parent, 'product', false, $language);
527
  $args['post_parent'] = is_null($product_parent) ? 0 : $product_parent;
528
  $_POST['to_lang'] = $language;
@@ -583,14 +590,14 @@ class WCML_Products{
583
  }
584
 
585
 
586
- $translations = $sitepress->get_element_translations($product_trid,'post_product');
587
  if(ob_get_length()){
588
  ob_clean();
589
  }
590
  ob_start();
591
  $return = array();
592
 
593
- $this->get_translation_statuses($translations,$languages,$default_language,$_POST['slang'] != 'all'?$_POST['slang']:false);
594
  $return['status'] = ob_get_clean();
595
 
596
 
@@ -863,11 +870,14 @@ class WCML_Products{
863
  }
864
 
865
 
866
- function get_translation_statuses($product_translations,$active_languages,$default_language,$slang = false){
867
  global $wpdb;
868
 
869
  foreach ($active_languages as $language) {
870
- if ($default_language != $language['code'] && (($slang && $slang == $language['code']) || !$slang) && (current_user_can('wpml_operate_woocommerce_multilingual') || wpml_check_user_is_translator($default_language,$language['code'])) && (!isset($_POST['translation_status_lang']) || (isset($_POST['translation_status_lang']) && ($_POST['translation_status_lang'] == $language['code']) || $_POST['translation_status_lang']==''))) {
 
 
 
871
  if (isset($product_translations[$language['code']])) {
872
  $tr_status = $wpdb->get_row($wpdb->prepare("SELECT status,needs_update FROM " . $wpdb->prefix . "icl_translation_status WHERE translation_id = %d", $product_translations[$language['code']]->translation_id));
873
  if(!$tr_status){
@@ -1596,7 +1606,8 @@ class WCML_Products{
1596
  $wpdb->posts,
1597
  array(
1598
  'post_parent' => is_null( $tr_parent_id )? 0 : $tr_parent_id,
1599
- 'post_status' => get_post_status( $duplicated_post_id )
 
1600
  ),
1601
  array( 'id' => $post_id )
1602
  );
@@ -2925,4 +2936,23 @@ function get_cart_attribute_translation($taxonomy,$attribute,$product_id,$tr_pro
2925
  die();
2926
  }
2927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2928
  }
152
  */
153
  function get_product_list($page = 1,$limit = 20){
154
  global $wpdb,$sitepress;
155
+
156
+ $products = $wpdb->get_results($wpdb->prepare("
157
+ SELECT p.ID,p.post_parent FROM $wpdb->posts AS p
158
+ LEFT JOIN {$wpdb->prefix}icl_translations AS icl ON icl.element_id = p.id
159
+ WHERE p.post_type = 'product' AND p.post_status IN ('publish','future','draft','pending','private') AND icl.element_type= 'post_product' AND icl.language_code = %s",
160
+ $sitepress->get_current_language()));
161
 
162
  return $this->display_hierarchical($products,$page,$limit);
163
  }
528
  $args['post_content'] = $data['content_' . $language];
529
  $args['post_excerpt'] = $data['excerpt_' . $language];
530
  $args['post_status'] = $orig_product->post_status;
531
+ $args['ping_status'] = $orig_product->ping_status;
532
+ $args['comment_status'] = $orig_product->comment_status;
533
  $product_parent = icl_object_id($orig_product->post_parent, 'product', false, $language);
534
  $args['post_parent'] = is_null($product_parent) ? 0 : $product_parent;
535
  $_POST['to_lang'] = $language;
590
  }
591
 
592
 
593
+ $translations = $sitepress->get_element_translations( $product_trid, 'post_product', false, false, true );
594
  if(ob_get_length()){
595
  ob_clean();
596
  }
597
  ob_start();
598
  $return = array();
599
 
600
+ $this->get_translation_statuses($translations,$languages,$default_language,isset($_POST['slang']) && $_POST['slang'] != 'all'?$_POST['slang']:false, $product_trid);
601
  $return['status'] = ob_get_clean();
602
 
603
 
870
  }
871
 
872
 
873
+ function get_translation_statuses($product_translations,$active_languages,$default_language,$slang = false, $trid = false ){
874
  global $wpdb;
875
 
876
  foreach ($active_languages as $language) {
877
+ if( $trid && !$this->user_can_translate_product( $trid, $language['code'] ) && $default_language != $language['code'] ){
878
+ $alt = __('No Permissions','wpml-wcml');
879
+ echo '<i title="'. $alt .'" class="stat_img"></i>';
880
+ }elseif ($default_language != $language['code'] && (($slang && $slang == $language['code']) || !$slang) && (current_user_can('wpml_operate_woocommerce_multilingual') || wpml_check_user_is_translator($default_language,$language['code'])) && (!isset($_POST['translation_status_lang']) || (isset($_POST['translation_status_lang']) && ($_POST['translation_status_lang'] == $language['code']) || $_POST['translation_status_lang']==''))) {
881
  if (isset($product_translations[$language['code']])) {
882
  $tr_status = $wpdb->get_row($wpdb->prepare("SELECT status,needs_update FROM " . $wpdb->prefix . "icl_translation_status WHERE translation_id = %d", $product_translations[$language['code']]->translation_id));
883
  if(!$tr_status){
1606
  $wpdb->posts,
1607
  array(
1608
  'post_parent' => is_null( $tr_parent_id )? 0 : $tr_parent_id,
1609
+ 'post_status' => get_post_status( $duplicated_post_id ),
1610
+ 'comment_status' => get_post( $duplicated_post_id )->comment_status
1611
  ),
1612
  array( 'id' => $post_id )
1613
  );
2936
  die();
2937
  }
2938
 
2939
+ // Check if user can translate product
2940
+ function user_can_translate_product( $trid, $language_code ){
2941
+ global $wpdb, $iclTranslationManagement;
2942
+ $current_translator = $iclTranslationManagement->get_current_translator();
2943
+ $job_id = $wpdb->get_var($wpdb->prepare("
2944
+ SELECT tj.job_id FROM {$wpdb->prefix}icl_translate_job tj
2945
+ JOIN {$wpdb->prefix}icl_translation_status ts ON tj.rid = ts.rid
2946
+ JOIN {$wpdb->prefix}icl_translations t ON ts.translation_id = t.translation_id
2947
+ WHERE t.trid = %d AND t.language_code='%s' AND ts.translator_id = %d
2948
+ ORDER BY tj.job_id DESC LIMIT 1
2949
+ ", $trid, $language_code, $current_translator->translator_id));
2950
+
2951
+ if( $job_id ){
2952
+ return true;
2953
+ }
2954
+
2955
+ return false;
2956
+ }
2957
+
2958
  }
inc/store-pages.class.php CHANGED
@@ -33,8 +33,8 @@ class WCML_Store_Pages{
33
  }
34
 
35
  $this->front_page_id = get_option('page_on_front');
36
- $this->shop_page_id = woocommerce_get_page_id('shop');
37
- $this->shop_page = get_post( woocommerce_get_page_id('shop') );
38
 
39
 
40
  $this->localize_flat_rates_shipping_classes();
@@ -139,7 +139,7 @@ class WCML_Store_Pages{
139
  if ( ! $q->is_main_query() )
140
  return;
141
 
142
- if (!empty($this->shop_page) && $q->get('page_id') !== $this->front_page_id && $this->shop_page_id == $q->get('page_id')) {
143
  $q->set( 'post_type', 'product' );
144
  $q->set( 'page_id', '' );
145
  if ( isset( $q->query['paged'] ) )
@@ -159,7 +159,6 @@ class WCML_Store_Pages{
159
  $q->is_singular = false;
160
  $q->is_post_type_archive = true;
161
  $q->is_archive = true;
162
- $q->queried_object = get_post_type_object('product');
163
  }
164
  }
165
 
33
  }
34
 
35
  $this->front_page_id = get_option('page_on_front');
36
+ $this->shop_page_id = wc_get_page_id('shop');
37
+ $this->shop_page = get_post( $this->shop_page_id );
38
 
39
 
40
  $this->localize_flat_rates_shipping_classes();
139
  if ( ! $q->is_main_query() )
140
  return;
141
 
142
+ if (!empty($this->shop_page) && $q->get('page_id') !== $this->front_page_id && ( $this->shop_page_id == $q->get('page_id') || ( !$q->get_queried_object_id() && $q->query && $this->shop_page_id == $this->front_page_id ) ) ) {
143
  $q->set( 'post_type', 'product' );
144
  $q->set( 'page_id', '' );
145
  if ( isset( $q->query['paged'] ) )
159
  $q->is_singular = false;
160
  $q->is_post_type_archive = true;
161
  $q->is_archive = true;
 
162
  }
163
  }
164
 
inc/terms.class.php CHANGED
@@ -1081,7 +1081,7 @@ class WCML_Terms{
1081
  }
1082
 
1083
  function shipping_terms($terms, $post_id, $taxonomy){
1084
- if(!is_admin() && ( get_post_type($post_id) == 'product' || get_post_type($post_id) == 'product_variation' ) && $taxonomy == 'product_shipping_class'){
1085
  global $sitepress;
1086
  remove_filter('get_the_terms',array($this,'shipping_terms'), 10, 3);
1087
  $terms = get_the_terms(icl_object_id($post_id,get_post_type($post_id),true,$sitepress->get_default_language()),'product_shipping_class');
1081
  }
1082
 
1083
  function shipping_terms($terms, $post_id, $taxonomy){
1084
+ if( ( !is_admin() || ( is_ajax() && isset($_POST['action']) && $_POST['action'] == 'woocommerce_update_order_review' ) ) && ( get_post_type($post_id) == 'product' || get_post_type($post_id) == 'product_variation' ) && $taxonomy == 'product_shipping_class'){
1085
  global $sitepress;
1086
  remove_filter('get_the_terms',array($this,'shipping_terms'), 10, 3);
1087
  $terms = get_the_terms(icl_object_id($post_id,get_post_type($post_id),true,$sitepress->get_default_language()),'product_shipping_class');
menu/management.php CHANGED
@@ -37,6 +37,7 @@ if(isset($_GET['tab'])){
37
  <a class="nav-tab <?php echo $current_tab == 'settings' ?'nav-tab-active':''; ?>" href="admin.php?page=wpml-wcml"><?php _e('General settings', 'wpml-wcml') ?></a>
38
  <?php endif; ?>
39
  <a class="nav-tab <?php echo $current_tab == 'products' ? 'nav-tab-active' : ''; ?>" href="admin.php?page=wpml-wcml&tab=products"><?php _e('Products', 'wpml-wcml') ?></a>
 
40
  <?php foreach($products_and_variation_taxonomies as $tax_key => $tax): if(!$sitepress->is_translated_taxonomy($tax_key)) continue; ?>
41
  <a class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] == $tax_key)?'nav-tab-active':''; ?>" href="admin.php?page=wpml-wcml&tab=<?php echo $tax_key; ?>" <?php if(!WCML_Terms::is_fully_translated($tax_key)): ?>title="<?php esc_attr_e('You have untranslated terms!', 'wpml-wcml'); ?>"<?php endif;?>>
42
  <?php echo $tax->labels->name ?>
@@ -52,13 +53,15 @@ if(isset($_GET['tab'])){
52
  &nbsp;<i class="icon-warning-sign"></i>
53
  <?php endif; ?>
54
  </a>
 
55
  <input type="hidden" id="wcml_update_term_translated_warnings_nonce" value="<?php echo wp_create_nonce('wcml_update_term_translated_warnings_nonce') ?>" />
56
-
57
  <?php endforeach; ?>
 
58
  <div class="wcml_wrap">
59
  <?php if(!isset($_GET['tab']) && current_user_can('wpml_manage_woocommerce_multilingual')): ?>
60
  <?php include WCML_PLUGIN_PATH . '/menu/sub/settings.php'; ?>
61
- <?php elseif(isset($all_products_taxonomies[$current_tab]) || isset($products_and_variation_taxonomies[$current_tab])): ?>
62
  <?php include WCML_PLUGIN_PATH . '/menu/sub/product-taxonomy.php'; ?>
63
  <?php elseif((isset($_GET['tab']) && $_GET['tab'] == 'products') || !current_user_can('wpml_manage_woocommerce_multilingual')): ?>
64
  <?php include WCML_PLUGIN_PATH . '/menu/sub/products.php'; ?>
37
  <a class="nav-tab <?php echo $current_tab == 'settings' ?'nav-tab-active':''; ?>" href="admin.php?page=wpml-wcml"><?php _e('General settings', 'wpml-wcml') ?></a>
38
  <?php endif; ?>
39
  <a class="nav-tab <?php echo $current_tab == 'products' ? 'nav-tab-active' : ''; ?>" href="admin.php?page=wpml-wcml&tab=products"><?php _e('Products', 'wpml-wcml') ?></a>
40
+ <?php if( current_user_can('wpml_operate_woocommerce_multilingual')): ?>
41
  <?php foreach($products_and_variation_taxonomies as $tax_key => $tax): if(!$sitepress->is_translated_taxonomy($tax_key)) continue; ?>
42
  <a class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] == $tax_key)?'nav-tab-active':''; ?>" href="admin.php?page=wpml-wcml&tab=<?php echo $tax_key; ?>" <?php if(!WCML_Terms::is_fully_translated($tax_key)): ?>title="<?php esc_attr_e('You have untranslated terms!', 'wpml-wcml'); ?>"<?php endif;?>>
43
  <?php echo $tax->labels->name ?>
53
  &nbsp;<i class="icon-warning-sign"></i>
54
  <?php endif; ?>
55
  </a>
56
+
57
  <input type="hidden" id="wcml_update_term_translated_warnings_nonce" value="<?php echo wp_create_nonce('wcml_update_term_translated_warnings_nonce') ?>" />
58
+
59
  <?php endforeach; ?>
60
+ <?php endif; ?>
61
  <div class="wcml_wrap">
62
  <?php if(!isset($_GET['tab']) && current_user_can('wpml_manage_woocommerce_multilingual')): ?>
63
  <?php include WCML_PLUGIN_PATH . '/menu/sub/settings.php'; ?>
64
+ <?php elseif(isset($all_products_taxonomies[$current_tab]) || isset($products_and_variation_taxonomies[$current_tab]) && current_user_can('wpml_operate_woocommerce_multilingual')): ?>
65
  <?php include WCML_PLUGIN_PATH . '/menu/sub/product-taxonomy.php'; ?>
66
  <?php elseif((isset($_GET['tab']) && $_GET['tab'] == 'products') || !current_user_can('wpml_manage_woocommerce_multilingual')): ?>
67
  <?php include WCML_PLUGIN_PATH . '/menu/sub/products.php'; ?>
menu/sub/product-data.php CHANGED
@@ -4,6 +4,10 @@ $product_images = $woocommerce_wpml->products->product_images_ids($product->ID);
4
  $product_contents = $woocommerce_wpml->products->get_product_contents($product_id);
5
  $trid = $sitepress->get_element_trid($product_id,'post_'.$product->post_type);
6
  $product_translations = $sitepress->get_element_translations($trid,'post_'.$product->post_type,true,true);
 
 
 
 
7
 
8
  $lang_codes = array();
9
  foreach ($active_languages as $language) {
@@ -48,7 +52,7 @@ $button_labels = array(
48
  </tr>
49
  </thead>
50
  <tbody>
51
- <?php foreach ($lang_codes as $key=>$lang) : ?>
52
  <?php if($key != $default_language && isset($product_translations[$key])
53
  && get_post_meta($product_translations[$key]->element_id, '_icl_lang_duplicate_of', true) == $product->ID):
54
  $is_duplicate_product = true; ?>
@@ -260,6 +264,7 @@ $button_labels = array(
260
 
261
  if(!$woocommerce_wpml->settings['first_editor_call']){
262
  //load editor js
 
263
  _WP_Editors::editor_js();
264
  $woocommerce_wpml->settings['first_editor_call'] = true;
265
  $woocommerce_wpml->update_settings();
4
  $product_contents = $woocommerce_wpml->products->get_product_contents($product_id);
5
  $trid = $sitepress->get_element_trid($product_id,'post_'.$product->post_type);
6
  $product_translations = $sitepress->get_element_translations($trid,'post_'.$product->post_type,true,true);
7
+ $check_on_permissions = false;
8
+ if(!current_user_can('wpml_operate_woocommerce_multilingual')){
9
+ $check_on_permissions = true;
10
+ }
11
 
12
  $lang_codes = array();
13
  foreach ($active_languages as $language) {
52
  </tr>
53
  </thead>
54
  <tbody>
55
+ <?php foreach ($lang_codes as $key=>$lang) : if($key != $default_language && $check_on_permissions && ! $woocommerce_wpml->products->user_can_translate_product( $trid, $key )) continue;?>
56
  <?php if($key != $default_language && isset($product_translations[$key])
57
  && get_post_meta($product_translations[$key]->element_id, '_icl_lang_duplicate_of', true) == $product->ID):
58
  $is_duplicate_product = true; ?>
264
 
265
  if(!$woocommerce_wpml->settings['first_editor_call']){
266
  //load editor js
267
+ if ( class_exists( '_WP_Editors' ) )
268
  _WP_Editors::editor_js();
269
  $woocommerce_wpml->settings['first_editor_call'] = true;
270
  $woocommerce_wpml->update_settings();
menu/sub/products.php CHANGED
@@ -1,16 +1,10 @@
1
  <?php
2
- $pn = isset($_GET['pn'])?$_GET['pn']:1;
3
- $lm = isset($_GET['lm'])?$_GET['lm']:20;
4
 
5
  $search = false;
6
- $pagination_url = 'admin.php?page=wpml-wcml&tab=products&pn=';
7
- if(isset($_GET['s']) && isset($_GET['cat']) && isset($_GET['trst']) && isset($_GET['st']) && isset($_GET['slang'])){
8
- $products_data = $this->products->get_products_from_filter($_GET['s'],$_GET['cat'],$_GET['trst'],$_GET['st'],$_GET['slang'],$pn,$lm);
9
- $products = $products_data['products'];
10
- $products_count = $products_data['count'];
11
- $search = true;
12
- $pagination_url = 'admin.php?page=wpml-wcml&tab=products&s='.$_GET['s'].'&cat='.$_GET['cat'].'&trst='.$_GET['trst'].'&st='.$_GET['st'].'&slang='.$_GET['slang'].'&pn=';
13
- }
14
 
15
  if(isset($_GET['prid'])){
16
  $products[] = get_post($_GET['prid']);
@@ -18,11 +12,41 @@ if(isset($_GET['prid'])){
18
  $pr_edit = true;
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  $current_language = $sitepress->get_current_language();
22
 
23
  if(!isset($products)){
 
24
  $products = $woocommerce_wpml->products->get_product_list($pn, $lm);
25
  $products_count = $woocommerce_wpml->products->get_products_count();
 
26
  }
27
 
28
  if($lm){
@@ -40,6 +64,7 @@ $woocommerce_wpml->update_settings();
40
  <h3><?php _e('WooCommerce Products','wpml-wcml'); ?></h3>
41
  <span style="display:none" id="wcml_product_update_button_label"><?php echo $button_labels['update'] ?></span>
42
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
 
43
  <div class="wcml_prod_filters">
44
  <select class="wcml_product_category">
45
  <option value="0"><?php _e('Any category', 'wpml-wcml'); ?></option>
@@ -80,6 +105,7 @@ $woocommerce_wpml->update_settings();
80
  <?php endforeach; ?>
81
  </select>
82
  </div>
 
83
  <div>
84
  <input type="text" class="wcml_product_name" placeholder="<?php _e('Search', 'wpml-wcml'); ?>" value="<?php echo isset($_GET['s'])?$_GET['s']:''; ?>"/>
85
  <input type="hidden" value="<?php echo admin_url('admin.php?page=wpml-wcml&tab=products'); ?>" class="wcml_products_admin_url" />
@@ -90,6 +116,7 @@ $woocommerce_wpml->update_settings();
90
  <button type="button" value="reset" class="button-secondary wcml_reset_search"><?php _e('Reset', 'wpml-wcml'); ?></button>
91
  <?php endif;?>
92
  </div>
 
93
 
94
  <?php if($products): ?>
95
  <div class="wcml_product_pagination">
@@ -153,7 +180,7 @@ $woocommerce_wpml->update_settings();
153
  </td>
154
  <td>
155
  <div class="translations_statuses prid_<?php echo $product->ID; ?>">
156
- <?php echo $woocommerce_wpml->products->get_translation_statuses($product_translations,$active_languages,$default_language,isset($_GET['slang']) && $_GET['slang'] != "all" ?$_GET['slang']:false); ?>
157
  </div>
158
  <span class="spinner"></span>
159
  <a href="#prid_<?php echo $product->ID; ?>" id="wcml_details_<?php echo $product->ID; ?>" class="wcml_details" data-text-opened="<?php _e('Close', 'wpml-wcml') ?>" data-text-closed="<?php _e('Edit translation', 'wpml-wcml') ?>"><?php _e('Edit translation', 'wpml-wcml') ?></a>
1
  <?php
2
+ $pn = isset($_GET['paged'])?$_GET['paged']:1;
3
+ $lm = (isset($_GET['lm']) && $_GET['lm'] > 0)?$_GET['lm']:20;
4
 
5
  $search = false;
6
+ $pagination_url = 'admin.php?page=wpml-wcml&tab=products&paged=';
7
+ $translator_id = false;
 
 
 
 
 
 
8
 
9
  if(isset($_GET['prid'])){
10
  $products[] = get_post($_GET['prid']);
12
  $pr_edit = true;
13
  }
14
 
15
+ if( !current_user_can('wpml_operate_woocommerce_multilingual') ) {
16
+ global $iclTranslationManagement,$wp_query;
17
+ $current_translator = $iclTranslationManagement->get_current_translator();
18
+ $translator_id = $current_translator->translator_id;
19
+
20
+ if(!isset($products)){
21
+ $icl_translation_filter['translator_id'] = $translator_id;
22
+ $icl_translation_filter['include_unassigned'] = true;
23
+ $icl_translation_filter['limit_no'] = $lm;
24
+ $translation_jobs = $iclTranslationManagement->get_translation_jobs((array)$icl_translation_filter);
25
+ $products = array();
26
+ foreach ($translation_jobs as $translation_job) {
27
+ $products[] = get_post($translation_job->original_doc_id);
28
+ }
29
+
30
+ $products_count = $wp_query->found_posts;
31
+ }
32
+
33
+ }
34
+
35
+ if(!isset($products) && isset($_GET['s']) && isset($_GET['cat']) && isset($_GET['trst']) && isset($_GET['st']) && isset($_GET['slang'])){
36
+ $products_data = $this->products->get_products_from_filter($_GET['s'],$_GET['cat'],$_GET['trst'],$_GET['st'],$_GET['slang'],$pn,$lm);
37
+ $products = $products_data['products'];
38
+ $products_count = $products_data['count'];
39
+ $search = true;
40
+ $pagination_url = 'admin.php?page=wpml-wcml&tab=products&s='.$_GET['s'].'&cat='.$_GET['cat'].'&trst='.$_GET['trst'].'&st='.$_GET['st'].'&slang='.$_GET['slang'].'&paged=';
41
+ }
42
+
43
  $current_language = $sitepress->get_current_language();
44
 
45
  if(!isset($products)){
46
+ if( current_user_can('wpml_operate_woocommerce_multilingual') ) {
47
  $products = $woocommerce_wpml->products->get_product_list($pn, $lm);
48
  $products_count = $woocommerce_wpml->products->get_products_count();
49
+ }
50
  }
51
 
52
  if($lm){
64
  <h3><?php _e('WooCommerce Products','wpml-wcml'); ?></h3>
65
  <span style="display:none" id="wcml_product_update_button_label"><?php echo $button_labels['update'] ?></span>
66
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
67
+ <?php if(!isset($_GET['prid']) && !$translator_id): ?>
68
  <div class="wcml_prod_filters">
69
  <select class="wcml_product_category">
70
  <option value="0"><?php _e('Any category', 'wpml-wcml'); ?></option>
105
  <?php endforeach; ?>
106
  </select>
107
  </div>
108
+
109
  <div>
110
  <input type="text" class="wcml_product_name" placeholder="<?php _e('Search', 'wpml-wcml'); ?>" value="<?php echo isset($_GET['s'])?$_GET['s']:''; ?>"/>
111
  <input type="hidden" value="<?php echo admin_url('admin.php?page=wpml-wcml&tab=products'); ?>" class="wcml_products_admin_url" />
116
  <button type="button" value="reset" class="button-secondary wcml_reset_search"><?php _e('Reset', 'wpml-wcml'); ?></button>
117
  <?php endif;?>
118
  </div>
119
+ <?php endif; ?>
120
 
121
  <?php if($products): ?>
122
  <div class="wcml_product_pagination">
180
  </td>
181
  <td>
182
  <div class="translations_statuses prid_<?php echo $product->ID; ?>">
183
+ <?php echo $woocommerce_wpml->products->get_translation_statuses($product_translations,$active_languages,$default_language,isset($_GET['slang']) && $_GET['slang'] != "all" ?$_GET['slang']:false,$trid,$translator_id); ?>
184
  </div>
185
  <span class="spinner"></span>
186
  <a href="#prid_<?php echo $product->ID; ?>" id="wcml_details_<?php echo $product->ID; ?>" class="wcml_details" data-text-opened="<?php _e('Close', 'wpml-wcml') ?>" data-text-closed="<?php _e('Edit translation', 'wpml-wcml') ?>"><?php _e('Edit translation', 'wpml-wcml') ?></a>
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
5
  License: GPLv2
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
- Stable tag: 3.4.2
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
@@ -41,11 +41,11 @@ You will also need [WPML](http://wpml.org), together with the String Translation
41
 
42
  = Minimum versions for WPML and modules =
43
 
44
- WooCommerce Multilingual checks that the following versions of WPML and its components are active:
45
 
46
  * WPML Multilingual CMS - 3.1.5
47
  * WPML String Translation - 2.0
48
- * WPML Translation Managenet - 1.9
49
  * WPML Media - 2.1
50
 
51
  Without having all these running, WooCommerce Multilingual will not be able to run.
@@ -74,9 +74,21 @@ In order for the checkout and store pages to appear translated, you need to crea
74
 
75
  1. Translation controls for products
76
  2. Product categories translations
 
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
 
 
 
 
 
 
80
  = 3.4.2 =
81
  * Accommodated taxonomy translation changes in WPML
82
 
5
  License: GPLv2
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
+ Stable tag: 3.4.3
9
 
10
  Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
11
 
41
 
42
  = Minimum versions for WPML and modules =
43
 
44
+ WooCommerce Multilingual checks that the following versions of WPML and their components are active:
45
 
46
  * WPML Multilingual CMS - 3.1.5
47
  * WPML String Translation - 2.0
48
+ * WPML Translation Management - 1.9
49
  * WPML Media - 2.1
50
 
51
  Without having all these running, WooCommerce Multilingual will not be able to run.
74
 
75
  1. Translation controls for products
76
  2. Product categories translations
77
+ 3. Multiple currencies
78
 
79
  == Changelog ==
80
 
81
+ = 3.4.3 =
82
+ * Bug fixed: Incorrect decimal separator for prices on WordPress admin
83
+ * Bug fixed: ‘Insert link’ button not working on products translator interface.
84
+ * Bug fixed: Switching currency after adding to cart was adding an additional item
85
+ * Bug fixed: Review setting not preserved on translation of variable product
86
+ * Bug fixed: “Visible on the products page” option for product attributes was still selectable for product translation.
87
+ * Bug fixed: Translation status icon not updated on products translator page
88
+ * Bug fixed: Shipping rate was lost when WPML is activated
89
+ * Bug fixed: WooCommerce ‘sort by’ links going to blog not products
90
+ * Bug fixed: Option to select currency position was missing immediately after a new currency was added
91
+
92
  = 3.4.2 =
93
  * Accommodated taxonomy translation changes in WPML
94
 
screenshot-3.png ADDED
Binary file
woocommerce_wpml.class.php CHANGED
@@ -325,7 +325,7 @@ class woocommerce_wpml {
325
  $user_lang_pairs = get_user_meta(get_current_user_id(), $wpdb->prefix.'language_pairs', true);
326
  if( !empty( $user_lang_pairs[$sitepress->get_default_language()] ) ){
327
  add_menu_page(__('WooCommerce Multilingual','wpml-wcml'),
328
- __('WooCommerce Multilingual','wpml-wcml'), 'wpml_operate_woocommerce_multilingual',
329
  'wpml-wcml', array($this, 'menu_content'), ICL_PLUGIN_URL . '/res/img/icon16.png');
330
  }
331
  }
@@ -390,7 +390,7 @@ class woocommerce_wpml {
390
  )
391
  );
392
 
393
- //load wp-editor srcipts
394
  wp_enqueue_script('word-count');
395
  wp_enqueue_script('editor');
396
  wp_enqueue_script( 'quicktags' );
325
  $user_lang_pairs = get_user_meta(get_current_user_id(), $wpdb->prefix.'language_pairs', true);
326
  if( !empty( $user_lang_pairs[$sitepress->get_default_language()] ) ){
327
  add_menu_page(__('WooCommerce Multilingual','wpml-wcml'),
328
+ __('WooCommerce Multilingual','wpml-wcml'), 'translate',
329
  'wpml-wcml', array($this, 'menu_content'), ICL_PLUGIN_URL . '/res/img/icon16.png');
330
  }
331
  }
390
  )
391
  );
392
 
393
+ //load wp-editor scripts
394
  wp_enqueue_script('word-count');
395
  wp_enqueue_script('editor');
396
  wp_enqueue_script( 'quicktags' );
wpml-woocommerce.php CHANGED
@@ -5,12 +5,12 @@
5
  Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
6
  Author: OnTheGoSystems
7
  Author URI: http://www.onthegosystems.com/
8
- Version: 3.4.2
9
  */
10
 
11
 
12
  if(defined('WCML_VERSION')) return;
13
- define('WCML_VERSION', '3.4.2');
14
  define('WCML_PLUGIN_PATH', dirname(__FILE__));
15
  define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
16
  define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);
5
  Description: Allows running fully multilingual e-Commerce sites with WooCommerce and WPML. <a href="http://wpml.org/documentation/related-projects/woocommerce-multilingual/">Documentation</a>.
6
  Author: OnTheGoSystems
7
  Author URI: http://www.onthegosystems.com/
8
+ Version: 3.4.3
9
  */
10
 
11
 
12
  if(defined('WCML_VERSION')) return;
13
+ define('WCML_VERSION', '3.4.3');
14
  define('WCML_PLUGIN_PATH', dirname(__FILE__));
15
  define('WCML_PLUGIN_FOLDER', basename(WCML_PLUGIN_PATH));
16
  define('WCML_PLUGIN_URL', plugins_url() . '/' . WCML_PLUGIN_FOLDER);